| 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/app_list/app_list_presenter_delegate.h" | 5 #include "ash/app_list/app_list_presenter_delegate.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/shelf/app_list_button.h" | 8 #include "ash/common/shelf/app_list_button.h" |
| 9 #include "ash/common/shelf/shelf_layout_manager.h" | 9 #include "ash/common/shelf/shelf_layout_manager.h" |
| 10 #include "ash/common/shelf/shelf_widget.h" | 10 #include "ash/common/shelf/shelf_widget.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 13 #include "ash/common/wm/wm_screen_util.h" | 13 #include "ash/common/wm/wm_screen_util.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/display/window_tree_host_manager.h" | |
| 17 #include "ash/public/cpp/shelf_types.h" | 16 #include "ash/public/cpp/shelf_types.h" |
| 18 #include "ash/public/cpp/shell_window_ids.h" | 17 #include "ash/public/cpp/shell_window_ids.h" |
| 19 #include "ash/root_window_controller.h" | 18 #include "ash/root_window_controller.h" |
| 20 #include "ash/screen_util.h" | 19 #include "ash/screen_util.h" |
| 21 #include "ash/shell.h" | 20 #include "ash/shell.h" |
| 22 #include "base/command_line.h" | 21 #include "base/command_line.h" |
| 23 #include "ui/app_list/app_list_constants.h" | 22 #include "ui/app_list/app_list_constants.h" |
| 24 #include "ui/app_list/app_list_switches.h" | 23 #include "ui/app_list/app_list_switches.h" |
| 25 #include "ui/app_list/presenter/app_list_presenter_impl.h" | 24 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
| 26 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" | 25 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 87 |
| 89 void AppListPresenterDelegate::Init(app_list::AppListView* view, | 88 void AppListPresenterDelegate::Init(app_list::AppListView* view, |
| 90 int64_t display_id, | 89 int64_t display_id, |
| 91 int current_apps_page) { | 90 int current_apps_page) { |
| 92 // App list needs to know the new shelf layout in order to calculate its | 91 // App list needs to know the new shelf layout in order to calculate its |
| 93 // UI layout when AppListView visibility changes. | 92 // UI layout when AppListView visibility changes. |
| 94 ash::Shell::GetPrimaryRootWindowController() | 93 ash::Shell::GetPrimaryRootWindowController() |
| 95 ->GetShelfLayoutManager() | 94 ->GetShelfLayoutManager() |
| 96 ->UpdateAutoHideState(); | 95 ->UpdateAutoHideState(); |
| 97 view_ = view; | 96 view_ = view; |
| 98 aura::Window* root_window = Shell::GetInstance() | 97 WmWindow* wm_root_window = |
| 99 ->window_tree_host_manager() | 98 WmShell::Get()->GetRootWindowForDisplayId(display_id); |
| 100 ->GetRootWindowForDisplayId(display_id); | 99 aura::Window* root_window = wm_root_window->aura_window(); |
| 101 WmWindow* wm_root_window = WmWindow::Get(root_window); | |
| 102 aura::Window* container = GetRootWindowController(root_window) | 100 aura::Window* container = GetRootWindowController(root_window) |
| 103 ->GetContainer(kShellWindowId_AppListContainer); | 101 ->GetContainer(kShellWindowId_AppListContainer); |
| 104 view->InitAsBubble(container, current_apps_page); | 102 view->InitAsBubble(container, current_apps_page); |
| 105 // The app list is centered over the display. | 103 // The app list is centered over the display. |
| 106 view->SetAnchorPoint(GetCenterOfDisplayForWindow( | 104 view->SetAnchorPoint(GetCenterOfDisplayForWindow( |
| 107 wm_root_window, GetMinimumBoundsHeightForAppList(view))); | 105 wm_root_window, GetMinimumBoundsHeightForAppList(view))); |
| 108 | 106 |
| 109 keyboard::KeyboardController* keyboard_controller = | 107 keyboard::KeyboardController* keyboard_controller = |
| 110 keyboard::KeyboardController::GetInstance(); | 108 keyboard::KeyboardController::GetInstance(); |
| 111 if (keyboard_controller) | 109 if (keyboard_controller) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 238 } |
| 241 | 239 |
| 242 //////////////////////////////////////////////////////////////////////////////// | 240 //////////////////////////////////////////////////////////////////////////////// |
| 243 // AppListPresenterDelegate, WmShelfObserver implementation: | 241 // AppListPresenterDelegate, WmShelfObserver implementation: |
| 244 | 242 |
| 245 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { | 243 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { |
| 246 UpdateBounds(); | 244 UpdateBounds(); |
| 247 } | 245 } |
| 248 | 246 |
| 249 } // namespace ash | 247 } // namespace ash |
| OLD | NEW |