Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: chrome/browser/chromeos/extensions/file_browser_private_api.h

Issue 13776005: drive: Fix two instances of madness in FileBrowserEventRouter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_browser_private_api.h
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.h b/chrome/browser/chromeos/extensions/file_browser_private_api.h
index ea88ebf1c893cefe8040406bf43c67ffb1e99133..08a6e2e87c3879bdce9c4dac9476cd58e0becf5e 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.h
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.h
@@ -57,12 +57,12 @@ class FileBrowserPrivateAPI : public ProfileKeyedService {
// Convenience function to return the FileBrowserPrivateAPI for a Profile.
static FileBrowserPrivateAPI* Get(Profile* profile);
- scoped_refptr<FileBrowserEventRouter> event_router() {
- return event_router_;
+ FileBrowserEventRouter* event_router() {
+ return event_router_.get();
}
private:
- scoped_refptr<FileBrowserEventRouter> event_router_;
+ scoped_ptr<FileBrowserEventRouter> event_router_;
};
// Implements the chrome.fileBrowserPrivate.logoutUser method.
@@ -107,20 +107,17 @@ class FileWatchBrowserFunctionBase : public AsyncExtensionFunction {
protected:
virtual ~FileWatchBrowserFunctionBase() {}
- virtual bool PerformFileWatchOperation(
- scoped_refptr<FileBrowserEventRouter> event_router,
- const base::FilePath& local_path, const base::FilePath& virtual_path,
+ // Performs a file watch operation (ex. adds or removes a file watch).
+ virtual void PerformFileWatchOperation(
+ const base::FilePath& local_path,
+ const base::FilePath& virtual_path,
const std::string& extension_id) = 0;
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- private:
- void RespondOnUIThread(bool success);
- void RunFileWatchOperationOnFileThread(
- scoped_refptr<FileBrowserEventRouter> event_router,
- const fileapi::FileSystemURL& file_url,
- const std::string& extension_id);
+ // Calls SendResponse() with |success| converted to base::Value.
+ void Respond(bool success);
};
// Implements the chrome.fileBrowserPrivate.addFileWatch method.
@@ -132,9 +129,10 @@ class AddFileWatchBrowserFunction : public FileWatchBrowserFunctionBase {
protected:
virtual ~AddFileWatchBrowserFunction() {}
- virtual bool PerformFileWatchOperation(
- scoped_refptr<FileBrowserEventRouter> event_router,
- const base::FilePath& local_path, const base::FilePath& virtual_path,
+ // FileWatchBrowserFunctionBase override.
+ virtual void PerformFileWatchOperation(
+ const base::FilePath& local_path,
+ const base::FilePath& virtual_path,
const std::string& extension_id) OVERRIDE;
};
@@ -148,9 +146,10 @@ class RemoveFileWatchBrowserFunction : public FileWatchBrowserFunctionBase {
protected:
virtual ~RemoveFileWatchBrowserFunction() {}
- virtual bool PerformFileWatchOperation(
- scoped_refptr<FileBrowserEventRouter> event_router,
- const base::FilePath& local_path, const base::FilePath& virtual_path,
+ // FileWatchBrowserFunctionBase override.
+ virtual void PerformFileWatchOperation(
+ const base::FilePath& local_path,
+ const base::FilePath& virtual_path,
const std::string& extension_id) OVERRIDE;
};

Powered by Google App Engine
This is Rietveld 408576698