| 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_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 public ProfileSyncServiceObserver, | 47 public ProfileSyncServiceObserver, |
| 48 public FileStatusObserver, | 48 public FileStatusObserver, |
| 49 public extensions::ExtensionRegistryObserver, | 49 public extensions::ExtensionRegistryObserver, |
| 50 public base::SupportsWeakPtr<SyncFileSystemService> { | 50 public base::SupportsWeakPtr<SyncFileSystemService> { |
| 51 public: | 51 public: |
| 52 typedef base::Callback<void(const base::ListValue&)> DumpFilesCallback; | 52 typedef base::Callback<void(const base::ListValue&)> DumpFilesCallback; |
| 53 typedef base::Callback<void(const RemoteFileSyncService::OriginStatusMap&)> | 53 typedef base::Callback<void(const RemoteFileSyncService::OriginStatusMap&)> |
| 54 ExtensionStatusMapCallback; | 54 ExtensionStatusMapCallback; |
| 55 | 55 |
| 56 // KeyedService implementation. | 56 // KeyedService implementation. |
| 57 virtual void Shutdown() OVERRIDE; | 57 virtual void Shutdown() override; |
| 58 | 58 |
| 59 void InitializeForApp(storage::FileSystemContext* file_system_context, | 59 void InitializeForApp(storage::FileSystemContext* file_system_context, |
| 60 const GURL& app_origin, | 60 const GURL& app_origin, |
| 61 const SyncStatusCallback& callback); | 61 const SyncStatusCallback& callback); |
| 62 | 62 |
| 63 void GetExtensionStatusMap(const ExtensionStatusMapCallback& callback); | 63 void GetExtensionStatusMap(const ExtensionStatusMapCallback& callback); |
| 64 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); | 64 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); |
| 65 void DumpDatabase(const DumpFilesCallback& callback); | 65 void DumpDatabase(const DumpFilesCallback& callback); |
| 66 | 66 |
| 67 // Returns the file |url|'s sync status. | 67 // Returns the file |url|'s sync status. |
| 68 void GetFileSyncStatus(const storage::FileSystemURL& url, | 68 void GetFileSyncStatus(const storage::FileSystemURL& url, |
| 69 const SyncFileStatusCallback& callback); | 69 const SyncFileStatusCallback& callback); |
| 70 | 70 |
| 71 void AddSyncEventObserver(SyncEventObserver* observer); | 71 void AddSyncEventObserver(SyncEventObserver* observer); |
| 72 void RemoveSyncEventObserver(SyncEventObserver* observer); | 72 void RemoveSyncEventObserver(SyncEventObserver* observer); |
| 73 | 73 |
| 74 LocalChangeProcessor* GetLocalChangeProcessor(const GURL& origin); | 74 LocalChangeProcessor* GetLocalChangeProcessor(const GURL& origin); |
| 75 | 75 |
| 76 // SyncProcessRunner::Client implementations. | 76 // SyncProcessRunner::Client implementations. |
| 77 virtual void OnSyncIdle() OVERRIDE; | 77 virtual void OnSyncIdle() override; |
| 78 virtual SyncServiceState GetSyncServiceState() OVERRIDE; | 78 virtual SyncServiceState GetSyncServiceState() override; |
| 79 virtual SyncFileSystemService* GetSyncService() OVERRIDE; | 79 virtual SyncFileSystemService* GetSyncService() override; |
| 80 | 80 |
| 81 void OnPromotionCompleted(int* num_running_jobs); | 81 void OnPromotionCompleted(int* num_running_jobs); |
| 82 void CheckIfIdle(); | 82 void CheckIfIdle(); |
| 83 | 83 |
| 84 TaskLogger* task_logger() { return &task_logger_; } | 84 TaskLogger* task_logger() { return &task_logger_; } |
| 85 | 85 |
| 86 void CallOnIdleForTesting(const base::Closure& callback); | 86 void CallOnIdleForTesting(const base::Closure& callback); |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 friend class SyncFileSystemServiceFactory; | 89 friend class SyncFileSystemServiceFactory; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 SyncStatusCode status, | 128 SyncStatusCode status, |
| 129 bool has_pending_local_changes); | 129 bool has_pending_local_changes); |
| 130 | 130 |
| 131 void OnRemoteServiceStateUpdated(RemoteServiceState state, | 131 void OnRemoteServiceStateUpdated(RemoteServiceState state, |
| 132 const std::string& description); | 132 const std::string& description); |
| 133 | 133 |
| 134 // extensions::ExtensionRegistryObserver implementations. | 134 // extensions::ExtensionRegistryObserver implementations. |
| 135 virtual void OnExtensionInstalled( | 135 virtual void OnExtensionInstalled( |
| 136 content::BrowserContext* browser_context, | 136 content::BrowserContext* browser_context, |
| 137 const extensions::Extension* extension, | 137 const extensions::Extension* extension, |
| 138 bool is_update) OVERRIDE; | 138 bool is_update) override; |
| 139 virtual void OnExtensionUnloaded( | 139 virtual void OnExtensionUnloaded( |
| 140 content::BrowserContext* browser_context, | 140 content::BrowserContext* browser_context, |
| 141 const extensions::Extension* extension, | 141 const extensions::Extension* extension, |
| 142 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | 142 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 143 virtual void OnExtensionUninstalled( | 143 virtual void OnExtensionUninstalled( |
| 144 content::BrowserContext* browser_context, | 144 content::BrowserContext* browser_context, |
| 145 const extensions::Extension* extension, | 145 const extensions::Extension* extension, |
| 146 extensions::UninstallReason reason) OVERRIDE; | 146 extensions::UninstallReason reason) override; |
| 147 virtual void OnExtensionLoaded( | 147 virtual void OnExtensionLoaded( |
| 148 content::BrowserContext* browser_context, | 148 content::BrowserContext* browser_context, |
| 149 const extensions::Extension* extension) OVERRIDE; | 149 const extensions::Extension* extension) override; |
| 150 | 150 |
| 151 // ProfileSyncServiceObserver implementation. | 151 // ProfileSyncServiceObserver implementation. |
| 152 virtual void OnStateChanged() OVERRIDE; | 152 virtual void OnStateChanged() override; |
| 153 | 153 |
| 154 // SyncFileStatusObserver implementation. | 154 // SyncFileStatusObserver implementation. |
| 155 virtual void OnFileStatusChanged(const storage::FileSystemURL& url, | 155 virtual void OnFileStatusChanged(const storage::FileSystemURL& url, |
| 156 SyncFileType file_type, | 156 SyncFileType file_type, |
| 157 SyncFileStatus sync_status, | 157 SyncFileStatus sync_status, |
| 158 SyncAction action_taken, | 158 SyncAction action_taken, |
| 159 SyncDirection direction) OVERRIDE; | 159 SyncDirection direction) override; |
| 160 | 160 |
| 161 // Check the profile's sync preference settings and call | 161 // Check the profile's sync preference settings and call |
| 162 // remote_file_service_->SetSyncEnabled() to update the status. | 162 // remote_file_service_->SetSyncEnabled() to update the status. |
| 163 // |profile_sync_service| must be non-null. | 163 // |profile_sync_service| must be non-null. |
| 164 void UpdateSyncEnabledStatus(ProfileSyncServiceBase* profile_sync_service); | 164 void UpdateSyncEnabledStatus(ProfileSyncServiceBase* profile_sync_service); |
| 165 | 165 |
| 166 // Runs the SyncProcessRunner method of all sync runners (e.g. for Local sync | 166 // Runs the SyncProcessRunner method of all sync runners (e.g. for Local sync |
| 167 // and Remote sync). | 167 // and Remote sync). |
| 168 void RunForEachSyncRunners(void(SyncProcessRunner::*method)()); | 168 void RunForEachSyncRunners(void(SyncProcessRunner::*method)()); |
| 169 | 169 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 188 | 188 |
| 189 bool promoting_demoted_changes_; | 189 bool promoting_demoted_changes_; |
| 190 base::Closure idle_callback_; | 190 base::Closure idle_callback_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); | 192 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace sync_file_system | 195 } // namespace sync_file_system |
| 196 | 196 |
| 197 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 197 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
| OLD | NEW |