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

Side by Side Diff: chrome/browser/ui/app_list/app_list_syncable_service.cc

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/apps/drive/drive_app_provider.h" 8 #include "chrome/browser/apps/drive/drive_app_provider.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // Note: model_observer_ is constructed after the initial sync changes are 227 // Note: model_observer_ is constructed after the initial sync changes are
228 // received in MergeDataAndStartSyncing(). Changes to the model before that 228 // received in MergeDataAndStartSyncing(). Changes to the model before that
229 // will be synced after the initial sync occurs. 229 // will be synced after the initial sync occurs.
230 if (extension_system->extension_service() && 230 if (extension_system->extension_service() &&
231 extension_system->extension_service()->is_ready()) { 231 extension_system->extension_service()->is_ready()) {
232 BuildModel(); 232 BuildModel();
233 return; 233 return;
234 } 234 }
235 235
236 // The extensions for this profile have not yet all been loaded. 236 // The extensions for this profile have not yet all been loaded.
237 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, 237 registrar_.Add(this,
238 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
238 content::Source<Profile>(profile)); 239 content::Source<Profile>(profile));
239 } 240 }
240 241
241 AppListSyncableService::~AppListSyncableService() { 242 AppListSyncableService::~AppListSyncableService() {
242 // Remove observers. 243 // Remove observers.
243 model_observer_.reset(); 244 model_observer_.reset();
244 245
245 STLDeleteContainerPairSecondPointers(sync_items_.begin(), sync_items_.end()); 246 STLDeleteContainerPairSecondPointers(sync_items_.begin(), sync_items_.end());
246 } 247 }
247 248
(...skipping 25 matching lines...) Expand all
273 void AppListSyncableService::Shutdown() { 274 void AppListSyncableService::Shutdown() {
274 // DriveAppProvider touches other KeyedServices in its dtor and needs be 275 // DriveAppProvider touches other KeyedServices in its dtor and needs be
275 // released in shutdown stage. 276 // released in shutdown stage.
276 drive_app_provider_.reset(); 277 drive_app_provider_.reset();
277 } 278 }
278 279
279 void AppListSyncableService::Observe( 280 void AppListSyncableService::Observe(
280 int type, 281 int type,
281 const content::NotificationSource& source, 282 const content::NotificationSource& source,
282 const content::NotificationDetails& details) { 283 const content::NotificationDetails& details) {
283 DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type); 284 DCHECK_EQ(extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, type);
284 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 285 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
285 registrar_.RemoveAll(); 286 registrar_.RemoveAll();
286 BuildModel(); 287 BuildModel();
287 } 288 }
288 289
289 const AppListSyncableService::SyncItem* 290 const AppListSyncableService::SyncItem*
290 AppListSyncableService::GetSyncItem(const std::string& id) const { 291 AppListSyncableService::GetSyncItem(const std::string& id) const {
291 SyncItemMap::const_iterator iter = sync_items_.find(id); 292 SyncItemMap::const_iterator iter = sync_items_.find(id);
292 if (iter != sync_items_.end()) 293 if (iter != sync_items_.end())
293 return iter->second; 294 return iter->second;
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 } else { 912 } else {
912 res += " { " + item_name + " }"; 913 res += " { " + item_name + " }";
913 res += " [" + item_ordinal.ToDebugString() + "]"; 914 res += " [" + item_ordinal.ToDebugString() + "]";
914 if (!parent_id.empty()) 915 if (!parent_id.empty())
915 res += " <" + parent_id.substr(0, 8) + ">"; 916 res += " <" + parent_id.substr(0, 8) + ">";
916 } 917 }
917 return res; 918 return res;
918 } 919 }
919 920
920 } // namespace app_list 921 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service_unittest.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698