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_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Creates a new sync item for |item_id|. | 174 // Creates a new sync item for |item_id|. |
175 SyncItem* CreateSyncItem( | 175 SyncItem* CreateSyncItem( |
176 const std::string& item_id, | 176 const std::string& item_id, |
177 sync_pb::AppListSpecifics::AppListItemType item_type); | 177 sync_pb::AppListSpecifics::AppListItemType item_type); |
178 | 178 |
179 // Deletes a SyncItem matching |specifics|. | 179 // Deletes a SyncItem matching |specifics|. |
180 void DeleteSyncItemSpecifics(const sync_pb::AppListSpecifics& specifics); | 180 void DeleteSyncItemSpecifics(const sync_pb::AppListSpecifics& specifics); |
181 | 181 |
182 // Creates the OEM folder and sets its name if necessary. Returns the OEM | 182 // Creates the OEM folder and sets its name if necessary. Returns the OEM |
183 // folder id or an empty string if the folder can not be created. |item_id| | 183 // folder id. |
184 // is the item that needs to be placed in the folder, used only for tracking | 184 std::string FindOrCreateOemFolder(); |
185 // if the folder can not be created. | |
186 std::string FindOrCreateOemFolder(const std::string& item_id); | |
187 | 185 |
188 // Gets the location for the OEM folder. Called when the folder is first | 186 // Gets the location for the OEM folder. Called when the folder is first |
189 // created. | 187 // created. |
190 syncer::StringOrdinal GetOemFolderPos(); | 188 syncer::StringOrdinal GetOemFolderPos(); |
191 | 189 |
192 // Returns true if an extension matching |id| exists and was installed by | 190 // Returns true if an extension matching |id| exists and was installed by |
193 // an OEM (extension->was_installed_by_oem() is true). | 191 // an OEM (extension->was_installed_by_oem() is true). |
194 bool AppIsOem(const std::string& id); | 192 bool AppIsOem(const std::string& id); |
195 | 193 |
196 Profile* profile_; | 194 Profile* profile_; |
197 extensions::ExtensionSystem* extension_system_; | 195 extensions::ExtensionSystem* extension_system_; |
198 content::NotificationRegistrar registrar_; | 196 content::NotificationRegistrar registrar_; |
199 scoped_ptr<AppListModel> model_; | 197 scoped_ptr<AppListModel> model_; |
200 scoped_ptr<ModelObserver> model_observer_; | 198 scoped_ptr<ModelObserver> model_observer_; |
201 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; | 199 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; |
202 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 200 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
203 scoped_ptr<syncer::SyncErrorFactory> sync_error_handler_; | 201 scoped_ptr<syncer::SyncErrorFactory> sync_error_handler_; |
204 SyncItemMap sync_items_; | 202 SyncItemMap sync_items_; |
205 syncer::SyncableService::StartSyncFlare flare_; | 203 syncer::SyncableService::StartSyncFlare flare_; |
206 bool first_app_list_sync_; | 204 bool first_app_list_sync_; |
207 std::string oem_folder_name_; | 205 std::string oem_folder_name_; |
208 std::vector<std::string> oem_folder_item_ids_; | |
209 | 206 |
210 // Provides integration with Drive apps. | 207 // Provides integration with Drive apps. |
211 scoped_ptr<DriveAppProvider> drive_app_provider_; | 208 scoped_ptr<DriveAppProvider> drive_app_provider_; |
212 | 209 |
213 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); | 210 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); |
214 }; | 211 }; |
215 | 212 |
216 } // namespace app_list | 213 } // namespace app_list |
217 | 214 |
218 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 215 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
OLD | NEW |