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

Side by Side Diff: ash/wm/app_list_controller.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 "ash/wm/app_list_controller.h" 5 #include "ash/wm/app_list_controller.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 11 #include "ash/shell_delegate.h"
11 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
12 #include "ash/wm/property_util.h" 13 #include "ash/wm/property_util.h"
13 #include "ash/wm/shelf_layout_manager.h"
14 #include "ui/app_list/app_list_constants.h" 14 #include "ui/app_list/app_list_constants.h"
15 #include "ui/app_list/pagination_model.h" 15 #include "ui/app_list/pagination_model.h"
16 #include "ui/app_list/views/app_list_view.h" 16 #include "ui/app_list/views/app_list_view.h"
17 #include "ui/aura/client/focus_client.h" 17 #include "ui/aura/client/focus_client.h"
18 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
19 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
20 #include "ui/base/events/event.h" 20 #include "ui/base/events/event.h"
21 #include "ui/compositor/layer.h" 21 #include "ui/compositor/layer.h"
22 #include "ui/compositor/scoped_layer_animation_settings.h" 22 #include "ui/compositor/scoped_layer_animation_settings.h"
23 #include "ui/gfx/transform_util.h" 23 #include "ui/gfx/transform_util.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 void AppListController::SetVisible(bool visible, aura::Window* window) { 104 void AppListController::SetVisible(bool visible, aura::Window* window) {
105 if (visible == is_visible_) 105 if (visible == is_visible_)
106 return; 106 return;
107 107
108 is_visible_ = visible; 108 is_visible_ = visible;
109 109
110 // App list needs to know the new shelf layout in order to calculate its 110 // App list needs to know the new shelf layout in order to calculate its
111 // UI layout when AppListView visibility changes. 111 // UI layout when AppListView visibility changes.
112 Shell::GetPrimaryRootWindowController()->shelf()->UpdateAutoHideState(); 112 Shell::GetPrimaryRootWindowController()->shelf_layout_manager()->
113 UpdateAutoHideState();
113 114
114 if (view_) { 115 if (view_) {
115 ScheduleAnimation(); 116 ScheduleAnimation();
116 } else if (is_visible_) { 117 } else if (is_visible_) {
117 // AppListModel and AppListViewDelegate are owned by AppListView. They 118 // AppListModel and AppListViewDelegate are owned by AppListView. They
118 // will be released with AppListView on close. 119 // will be released with AppListView on close.
119 app_list::AppListView* view = new app_list::AppListView( 120 app_list::AppListView* view = new app_list::AppListView(
120 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); 121 Shell::GetInstance()->delegate()->CreateAppListViewDelegate());
121 aura::Window* container = GetRootWindowController(window->GetRootWindow())-> 122 aura::Window* container = GetRootWindowController(window->GetRootWindow())->
122 GetContainer(kShellWindowId_AppListContainer); 123 GetContainer(kShellWindowId_AppListContainer);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 should_snap_back_ = false; 343 should_snap_back_ = false;
343 ui::ScopedLayerAnimationSettings animation(widget_animator); 344 ui::ScopedLayerAnimationSettings animation(widget_animator);
344 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 345 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
345 app_list::kOverscrollPageTransitionDurationMs)); 346 app_list::kOverscrollPageTransitionDurationMs));
346 widget->SetBounds(view_bounds_); 347 widget->SetBounds(view_bounds_);
347 } 348 }
348 } 349 }
349 350
350 } // namespace internal 351 } // namespace internal
351 } // namespace ash 352 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698