Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service.h

Issue 148403007: Protect AppListItemList Add/Remove and fix sync bugs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_syncable_service.h
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.h b/chrome/browser/ui/app_list/app_list_syncable_service.h
index 1de32a9d05ee626f49f6c8e3facd4ef46b657317..f8fbab705fe075ccf024d77e1c2e423d0dbe0e3b 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service.h
+++ b/chrome/browser/ui/app_list/app_list_syncable_service.h
@@ -88,7 +88,7 @@ class AppListSyncableService : public syncer::SyncableService,
const syncer::SyncChangeList& change_list) OVERRIDE;
private:
- class ItemListObserver;
+ class ModelObserver;
typedef std::map<std::string, SyncItem*> SyncItemMap;
// content::NotificationObserver
@@ -102,10 +102,10 @@ class AppListSyncableService : public syncer::SyncableService,
// Returns true if sync has restarted, otherwise runs |flare_|.
bool SyncStarted();
- // If |app_item| matches an existing sync item, updates the sync item and
- // returns it. Otherwise adds |app_item| to |sync_items_| and returns the new
- // item. If |app_item| is invalid returns NULL.
- SyncItem* AddOrUpdateSyncItem(AppListItem* app_item);
+ // If |app_item| matches an existing sync item, returns it. Otherwise adds
+ // |app_item| to |sync_items_| and returns the new item. If |app_item| is
+ // invalid returns NULL.
+ SyncItem* FindOrAddSyncItem(AppListItem* app_item);
// Creates a sync item for |app_item| and sends an ADD SyncChange event.
SyncItem* CreateSyncItemFromAppItem(AppListItem* app_item);
@@ -162,7 +162,7 @@ class AppListSyncableService : public syncer::SyncableService,
extensions::ExtensionSystem* extension_system_;
content::NotificationRegistrar registrar_;
scoped_ptr<AppListModel> model_;
- scoped_ptr<ItemListObserver> item_list_observer_;
+ scoped_ptr<ModelObserver> model_observer_;
scoped_ptr<ExtensionAppModelBuilder> apps_builder_;
scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
scoped_ptr<syncer::SyncErrorFactory> sync_error_handler_;

Powered by Google App Engine
This is Rietveld 408576698