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

Unified Diff: chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h

Issue 168253002: Cleanup many APIs to use ProfileKeyedAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/extensions/api/sync_file_system/extension_sync_event_observer.h
diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
index 78055eb97814e63f14eb01b70897cfba8b505304..491e9b0725708db84cd83d4d5265995ea883e014 100644
--- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
+++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
@@ -9,8 +9,8 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/sync_file_system/sync_event_observer.h"
-#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
class Profile;
@@ -21,10 +21,12 @@ class SyncFileSystemService;
namespace extensions {
// Observes changes in SyncFileSystem and relays events to JS Extension API.
-class ExtensionSyncEventObserver
- : public sync_file_system::SyncEventObserver,
- public BrowserContextKeyedService {
+class ExtensionSyncEventObserver : public sync_file_system::SyncEventObserver,
+ public ProfileKeyedAPI {
public:
+ static ProfileKeyedAPIFactory<ExtensionSyncEventObserver>*
+ GetFactoryInstance();
+
explicit ExtensionSyncEventObserver(Profile* profile);
virtual ~ExtensionSyncEventObserver();
@@ -47,10 +49,16 @@ class ExtensionSyncEventObserver
sync_file_system::SyncDirection direction) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<ExtensionSyncEventObserver>;
+
// Returns an empty string if the extension |app_origin| cannot be found
// in the installed extension list.
std::string GetExtensionId(const GURL& app_origin);
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() { return "ExtensionSyncEventObserver"; }
+ static const bool kServiceIsCreatedWithBrowserContext = false;
+
Profile* profile_;
// Not owned. If not null, then this is registered to SyncFileSystemService.
@@ -63,6 +71,10 @@ class ExtensionSyncEventObserver
DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver);
};
+template <>
+void ProfileKeyedAPIFactory<
+ ExtensionSyncEventObserver>::DeclareFactoryDependencies();
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698