Eliminate FilePathWatcher::Delegate.

BUG=130980

Review URL: https://codereview.chromium.org/11876025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176768 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 6b5d002b9b35024c284717dbee2bb2f1eb816902
diff --git a/base/files/file_path_watcher.cc b/base/files/file_path_watcher.cc
index bc8db37..3802ee3 100644
--- a/base/files/file_path_watcher.cc
+++ b/base/files/file_path_watcher.cc
@@ -13,33 +13,6 @@
 namespace base {
 namespace files {
 
-namespace {
-
-// A delegate implementation for the callback interface.
-class FilePathWatcherDelegate : public base::files::FilePathWatcher::Delegate {
- public:
-  explicit FilePathWatcherDelegate(const FilePathWatcher::Callback& callback)
-      : callback_(callback) {}
-
-  // FilePathWatcher::Delegate implementation.
-  virtual void OnFilePathChanged(const FilePath& path) OVERRIDE {
-    callback_.Run(path, false);
-  }
-
-  virtual void OnFilePathError(const FilePath& path) OVERRIDE {
-    callback_.Run(path, true);
-  }
-
- private:
-  virtual ~FilePathWatcherDelegate() {}
-
-  FilePathWatcher::Callback callback_;
-
-  DISALLOW_COPY_AND_ASSIGN(FilePathWatcherDelegate);
-};
-
-}  // namespace
-
 FilePathWatcher::~FilePathWatcher() {
   impl_->Cancel();
 }
@@ -50,11 +23,6 @@
   delegate->CancelOnMessageLoopThread();
 }
 
-bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) {
-  DCHECK(path.IsAbsolute());
-  return impl_->Watch(path, false, delegate);
-}
-
 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
 }
 
@@ -66,7 +34,7 @@
                             bool recursive,
                             const Callback& callback) {
   DCHECK(path.IsAbsolute());
-  return impl_->Watch(path, recursive, new FilePathWatcherDelegate(callback));
+  return impl_->Watch(path, recursive, callback);
 }
 
 }  // namespace files