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

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: address comments 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 tracked_objects::ScopedTracker tracking_profile3( 296 tracked_objects::ScopedTracker tracking_profile3(
297 FROM_HERE_WITH_EXPLICIT_FUNCTION( 297 FROM_HERE_WITH_EXPLICIT_FUNCTION(
298 "431326 AppListViewDelegate::SetProfile3")); 298 "431326 AppListViewDelegate::SetProfile3"));
299 template_url_service_observer_.RemoveAll(); 299 template_url_service_observer_.RemoveAll();
300 if (app_list::switches::IsExperimentalAppListEnabled()) { 300 if (app_list::switches::IsExperimentalAppListEnabled()) {
301 TemplateURLService* template_url_service = 301 TemplateURLService* template_url_service =
302 TemplateURLServiceFactory::GetForProfile(profile_); 302 TemplateURLServiceFactory::GetForProfile(profile_);
303 template_url_service_observer_.Add(template_url_service); 303 template_url_service_observer_.Add(template_url_service);
304 } 304 }
305 305
306 model_ = 306 model_ = app_list::AppListSyncableServiceFactory::GetForProfile(profile_)
307 app_list::AppListSyncableServiceFactory::GetForProfile(profile_)->model(); 307 ->GetModel();
308 308
309 #if defined(USE_ASH) 309 #if defined(USE_ASH)
310 app_sync_ui_state_watcher_.reset(new AppSyncUIStateWatcher(profile_, model_)); 310 app_sync_ui_state_watcher_.reset(new AppSyncUIStateWatcher(profile_, model_));
311 #endif 311 #endif
312 312
313 SetUpSearchUI(); 313 SetUpSearchUI();
314 SetUpProfileSwitcher(); 314 SetUpProfileSwitcher();
315 SetUpCustomLauncherPages(); 315 SetUpCustomLauncherPages();
316 OnTemplateURLServiceChanged(); 316 OnTemplateURLServiceChanged();
317 317
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 834
835 // SigninManagerFactory is not a leaky singleton (unlike this class), and 835 // SigninManagerFactory is not a leaky singleton (unlike this class), and
836 // its destructor will check that it has no remaining observers. 836 // its destructor will check that it has no remaining observers.
837 scoped_observer_.RemoveAll(); 837 scoped_observer_.RemoveAll();
838 SigninManagerFactory::GetInstance()->RemoveObserver(this); 838 SigninManagerFactory::GetInstance()->RemoveObserver(this);
839 break; 839 break;
840 default: 840 default:
841 NOTREACHED(); 841 NOTREACHED();
842 } 842 }
843 } 843 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698