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

Unified Diff: ash/wm/app_list_controller.cc

Issue 11418312: app_list: Improve initial icon loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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: ash/wm/app_list_controller.cc
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index 2abb2b94b561387b74ddf93f724aa7eb11f648d4..1e668f8f49351a9f0c4b33cf8374d83a9d94f796 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -153,22 +153,17 @@ aura::Window* AppListController::GetWindow() {
void AppListController::SetView(app_list::AppListView* view) {
DCHECK(view_ == NULL);
+ DCHECK(is_visible_);
- if (is_visible_) {
- view_ = view;
- views::Widget* widget = view_->GetWidget();
- widget->AddObserver(this);
- Shell::GetInstance()->AddPreTargetHandler(this);
- Launcher::ForWindow(GetWindow())->AddIconObserver(this);
- widget->GetNativeView()->GetRootWindow()->AddRootWindowObserver(this);
- aura::client::GetFocusClient(widget->GetNativeView())->AddObserver(this);
- widget->SetOpacity(0);
- ScheduleAnimation();
+ view_ = view;
+ views::Widget* widget = view_->GetWidget();
+ widget->AddObserver(this);
+ Shell::GetInstance()->AddPreTargetHandler(this);
+ Launcher::ForWindow(GetWindow())->AddIconObserver(this);
+ widget->GetNativeView()->GetRootWindow()->AddRootWindowObserver(this);
+ aura::client::GetFocusClient(widget->GetNativeView())->AddObserver(this);
- view_->GetWidget()->Show();
- } else {
- view->GetWidget()->Close();
- }
+ view_->ShowWhenReady();
}
void AppListController::ResetView() {

Powered by Google App Engine
This is Rietveld 408576698