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

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

Issue 981893002: Lazily build the app list model. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_set_enabled
Patch Set: revert ALSL Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/custom_launcher_page_contents.h" 9 #include "apps/custom_launcher_page_contents.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 tracked_objects::ScopedTracker tracking_profile3( 307 tracked_objects::ScopedTracker tracking_profile3(
308 FROM_HERE_WITH_EXPLICIT_FUNCTION( 308 FROM_HERE_WITH_EXPLICIT_FUNCTION(
309 "431326 AppListViewDelegate::SetProfile3")); 309 "431326 AppListViewDelegate::SetProfile3"));
310 template_url_service_observer_.RemoveAll(); 310 template_url_service_observer_.RemoveAll();
311 if (app_list::switches::IsExperimentalAppListEnabled()) { 311 if (app_list::switches::IsExperimentalAppListEnabled()) {
312 TemplateURLService* template_url_service = 312 TemplateURLService* template_url_service =
313 TemplateURLServiceFactory::GetForProfile(profile_); 313 TemplateURLServiceFactory::GetForProfile(profile_);
314 template_url_service_observer_.Add(template_url_service); 314 template_url_service_observer_.Add(template_url_service);
315 } 315 }
316 316
317 model_ = 317 model_ = app_list::AppListSyncableServiceFactory::GetForProfile(profile_)
318 app_list::AppListSyncableServiceFactory::GetForProfile(profile_)->model(); 318 ->GetModel();
319 319
320 #if defined(USE_ASH) 320 #if defined(USE_ASH)
321 app_sync_ui_state_watcher_.reset(new AppSyncUIStateWatcher(profile_, model_)); 321 app_sync_ui_state_watcher_.reset(new AppSyncUIStateWatcher(profile_, model_));
322 #endif 322 #endif
323 323
324 SetUpSearchUI(); 324 SetUpSearchUI();
325 SetUpProfileSwitcher(); 325 SetUpProfileSwitcher();
326 SetUpCustomLauncherPages(); 326 SetUpCustomLauncherPages();
327 OnTemplateURLServiceChanged(); 327 OnTemplateURLServiceChanged();
328 328
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 845
846 // SigninManagerFactory is not a leaky singleton (unlike this class), and 846 // SigninManagerFactory is not a leaky singleton (unlike this class), and
847 // its destructor will check that it has no remaining observers. 847 // its destructor will check that it has no remaining observers.
848 scoped_observer_.RemoveAll(); 848 scoped_observer_.RemoveAll();
849 SigninManagerFactory::GetInstance()->RemoveObserver(this); 849 SigninManagerFactory::GetInstance()->RemoveObserver(this);
850 break; 850 break;
851 default: 851 default:
852 NOTREACHED(); 852 NOTREACHED();
853 } 853 }
854 } 854 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service.cc ('k') | chrome/browser/ui/app_list/extension_app_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698