OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE
RVER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE
RVER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE
RVER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE
RVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/sync_file_system/sync_event_observer.h" | 12 #include "chrome/browser/sync_file_system/sync_event_observer.h" |
13 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 13 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace sync_file_system { | 17 namespace sync_file_system { |
18 class SyncFileSystemService; | 18 class SyncFileSystemService; |
19 } | 19 } |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 | 22 |
23 // Observes changes in SyncFileSystem and relays events to JS Extension API. | 23 // Observes changes in SyncFileSystem and relays events to JS Extension API. |
24 class ExtensionSyncEventObserver | 24 class ExtensionSyncEventObserver |
25 : public sync_file_system::SyncEventObserver, | 25 : public sync_file_system::SyncEventObserver, |
26 public ProfileKeyedService { | 26 public BrowserContextKeyedService { |
27 public: | 27 public: |
28 explicit ExtensionSyncEventObserver(Profile* profile); | 28 explicit ExtensionSyncEventObserver(Profile* profile); |
29 virtual ~ExtensionSyncEventObserver(); | 29 virtual ~ExtensionSyncEventObserver(); |
30 | 30 |
31 void InitializeForService( | 31 void InitializeForService( |
32 sync_file_system::SyncFileSystemService* sync_service, | 32 sync_file_system::SyncFileSystemService* sync_service, |
33 const std::string& service_name); | 33 const std::string& service_name); |
34 | 34 |
35 // ProfileKeyedService override. | 35 // BrowserContextKeyedService override. |
36 virtual void Shutdown() OVERRIDE; | 36 virtual void Shutdown() OVERRIDE; |
37 | 37 |
38 // sync_file_system::SyncEventObserver interface implementation. | 38 // sync_file_system::SyncEventObserver interface implementation. |
39 virtual void OnSyncStateUpdated( | 39 virtual void OnSyncStateUpdated( |
40 const GURL& app_origin, | 40 const GURL& app_origin, |
41 sync_file_system::SyncServiceState state, | 41 sync_file_system::SyncServiceState state, |
42 const std::string& description) OVERRIDE; | 42 const std::string& description) OVERRIDE; |
43 | 43 |
44 virtual void OnFileSynced( | 44 virtual void OnFileSynced( |
45 const fileapi::FileSystemURL& url, | 45 const fileapi::FileSystemURL& url, |
(...skipping 15 matching lines...) Expand all Loading... |
61 void BroadcastOrDispatchEvent(const GURL& app_origin, | 61 void BroadcastOrDispatchEvent(const GURL& app_origin, |
62 const std::string& event_name, | 62 const std::string& event_name, |
63 scoped_ptr<base::ListValue> value); | 63 scoped_ptr<base::ListValue> value); |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver); | 65 DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace extensions | 68 } // namespace extensions |
69 | 69 |
70 #endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_O
BSERVER_H_ | 70 #endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_O
BSERVER_H_ |
OLD | NEW |