| 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..0563807cfa9d6cdb4c2c66f9166a38c11a3e427f 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,10 +9,12 @@
|
| #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;
|
| +namespace content {
|
| +class BrowserContext;
|
| +}
|
|
|
| namespace sync_file_system {
|
| class SyncFileSystemService;
|
| @@ -21,11 +23,13 @@ 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:
|
| - explicit ExtensionSyncEventObserver(Profile* profile);
|
| + static ProfileKeyedAPIFactory<ExtensionSyncEventObserver>*
|
| + GetFactoryInstance();
|
| +
|
| + explicit ExtensionSyncEventObserver(content::BrowserContext* context);
|
| virtual ~ExtensionSyncEventObserver();
|
|
|
| void InitializeForService(
|
| @@ -47,11 +51,17 @@ 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);
|
|
|
| - Profile* profile_;
|
| + // ProfileKeyedAPI implementation.
|
| + static const char* service_name() { return "ExtensionSyncEventObserver"; }
|
| + static const bool kServiceIsCreatedWithBrowserContext = false;
|
| +
|
| + content::BrowserContext* browser_context_;
|
|
|
| // Not owned. If not null, then this is registered to SyncFileSystemService.
|
| sync_file_system::SyncFileSystemService* sync_service_;
|
| @@ -63,6 +73,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_
|
|
|