OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |