summaryrefslogtreecommitdiffstats
path: root/ash/wm/app_list_controller.cc
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 20:38:50 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 20:38:50 +0000
commitce007882a76f03f6f852dbc4d6faf63d79504fb9 (patch)
treef265e4f4b175299f5f66ee7cff6bfc44eaf9a04f /ash/wm/app_list_controller.cc
parent7a8bf98ea8e3225918b9df62163fca5f84e89741 (diff)
downloadchromium_src-ce007882a76f03f6f852dbc4d6faf63d79504fb9.zip
chromium_src-ce007882a76f03f6f852dbc4d6faf63d79504fb9.tar.gz
chromium_src-ce007882a76f03f6f852dbc4d6faf63d79504fb9.tar.bz2
app_list: Improve initial icon loading.
- Creates and populates AppListModel and starts icon loading for current page apps before creating views; - Shows UI when all icons are loaded or a maximum wait time has passed (currently 50ms); BUG=161025 TEST=Bring up app launcher and the app icons should not flash. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11418312 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r--ash/wm/app_list_controller.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index bf02979..012a7c5 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -145,22 +145,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() {