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 #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/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (app_list::switches::IsAppListSyncEnabled()) { | 236 if (app_list::switches::IsAppListSyncEnabled()) { |
237 VLOG(1) << this << ": AppListSyncableService: InitializeWithService."; | 237 VLOG(1) << this << ": AppListSyncableService: InitializeWithService."; |
238 SyncStarted(); | 238 SyncStarted(); |
239 apps_builder_->InitializeWithService(this); | 239 apps_builder_->InitializeWithService(this); |
240 } else { | 240 } else { |
241 VLOG(1) << this << ": AppListSyncableService: InitializeWithProfile."; | 241 VLOG(1) << this << ": AppListSyncableService: InitializeWithProfile."; |
242 apps_builder_->InitializeWithProfile(profile_, model_.get()); | 242 apps_builder_->InitializeWithProfile(profile_, model_.get()); |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
| 246 void AppListSyncableService::Shutdown() { |
| 247 // DriveAppProvider in |apps_builder_| touches other KeyedServices in |
| 248 // dtor and needs be released in shutdown stage. |
| 249 apps_builder_.reset(); |
| 250 } |
| 251 |
246 void AppListSyncableService::Observe( | 252 void AppListSyncableService::Observe( |
247 int type, | 253 int type, |
248 const content::NotificationSource& source, | 254 const content::NotificationSource& source, |
249 const content::NotificationDetails& details) { | 255 const content::NotificationDetails& details) { |
250 DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type); | 256 DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type); |
251 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 257 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
252 registrar_.RemoveAll(); | 258 registrar_.RemoveAll(); |
253 BuildModel(); | 259 BuildModel(); |
254 } | 260 } |
255 | 261 |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } else { | 811 } else { |
806 res += " { " + item_name + " }"; | 812 res += " { " + item_name + " }"; |
807 res += " [" + item_ordinal.ToDebugString() + "]"; | 813 res += " [" + item_ordinal.ToDebugString() + "]"; |
808 if (!parent_id.empty()) | 814 if (!parent_id.empty()) |
809 res += " <" + parent_id.substr(0, 8) + ">"; | 815 res += " <" + parent_id.substr(0, 8) + ">"; |
810 } | 816 } |
811 return res; | 817 return res; |
812 } | 818 } |
813 | 819 |
814 } // namespace app_list | 820 } // namespace app_list |
OLD | NEW |