OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSION_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 public: | 36 public: |
37 ExtensionSyncService(Profile* profile, | 37 ExtensionSyncService(Profile* profile, |
38 extensions::ExtensionPrefs* extension_prefs, | 38 extensions::ExtensionPrefs* extension_prefs, |
39 ExtensionService* extension_service); | 39 ExtensionService* extension_service); |
40 | 40 |
41 ~ExtensionSyncService() override; | 41 ~ExtensionSyncService() override; |
42 | 42 |
43 // Convenience function to get the ExtensionSyncService for a BrowserContext. | 43 // Convenience function to get the ExtensionSyncService for a BrowserContext. |
44 static ExtensionSyncService* Get(content::BrowserContext* context); | 44 static ExtensionSyncService* Get(content::BrowserContext* context); |
45 | 45 |
46 // Extracts the data needed to sync the uninstall of |extension|, but doesn't | 46 void SyncUninstallExtension(const extensions::Extension& extension); |
47 // actually sync anything now. Call |ProcessSyncUninstallExtension| later with | |
48 // the returned SyncData to actually commit the change. | |
49 syncer::SyncData PrepareToSyncUninstallExtension( | |
50 const extensions::Extension& extension); | |
51 // Commit a sync uninstall that was previously prepared with | |
52 // PrepareToSyncUninstallExtension. | |
53 void ProcessSyncUninstallExtension(const std::string& extension_id, | |
54 const syncer::SyncData& sync_data); | |
55 | 47 |
56 void SyncEnableExtension(const extensions::Extension& extension); | 48 void SyncEnableExtension(const extensions::Extension& extension); |
57 void SyncDisableExtension(const extensions::Extension& extension); | 49 void SyncDisableExtension(const extensions::Extension& extension); |
58 | 50 |
59 void SyncOrderingChange(const std::string& extension_id); | 51 void SyncOrderingChange(const std::string& extension_id); |
60 | 52 |
61 // Notifies Sync (if needed) of a newly-installed extension or a change to | 53 // Notifies Sync (if needed) of a newly-installed extension or a change to |
62 // an existing extension. | 54 // an existing extension. |
63 void SyncExtensionChangeIfNeeded(const extensions::Extension& extension); | 55 void SyncExtensionChangeIfNeeded(const extensions::Extension& extension); |
64 | 56 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 131 |
140 // Run()ning tells sync to try and start soon, because syncable changes | 132 // Run()ning tells sync to try and start soon, because syncable changes |
141 // have started happening. It will cause sync to call us back | 133 // have started happening. It will cause sync to call us back |
142 // asynchronously via MergeDataAndStartSyncing as soon as possible. | 134 // asynchronously via MergeDataAndStartSyncing as soon as possible. |
143 syncer::SyncableService::StartSyncFlare flare_; | 135 syncer::SyncableService::StartSyncFlare flare_; |
144 | 136 |
145 DISALLOW_COPY_AND_ASSIGN(ExtensionSyncService); | 137 DISALLOW_COPY_AND_ASSIGN(ExtensionSyncService); |
146 }; | 138 }; |
147 | 139 |
148 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_SERVICE_H_ | 140 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_SERVICE_H_ |
OLD | NEW |