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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/public/cpp/shelf_types.h" | 8 #include "ash/public/cpp/shelf_types.h" |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 // UI layout when AppListView visibility changes. | 92 // UI layout when AppListView visibility changes. |
93 ash::Shell::GetPrimaryRootWindowController() | 93 ash::Shell::GetPrimaryRootWindowController() |
94 ->GetShelfLayoutManager() | 94 ->GetShelfLayoutManager() |
95 ->UpdateAutoHideState(); | 95 ->UpdateAutoHideState(); |
96 view_ = view; | 96 view_ = view; |
97 WmWindow* wm_root_window = | 97 WmWindow* wm_root_window = |
98 ShellPort::Get()->GetRootWindowForDisplayId(display_id); | 98 ShellPort::Get()->GetRootWindowForDisplayId(display_id); |
99 aura::Window* root_window = wm_root_window->aura_window(); | 99 aura::Window* root_window = wm_root_window->aura_window(); |
100 aura::Window* container = GetRootWindowController(root_window) | 100 aura::Window* container = GetRootWindowController(root_window) |
101 ->GetContainer(kShellWindowId_AppListContainer); | 101 ->GetContainer(kShellWindowId_AppListContainer); |
102 view->InitAsBubble(container, current_apps_page); | 102 view->Initialize( |
103 // The app list is centered over the display. | 103 container, current_apps_page, |
104 view->SetAnchorPoint(GetCenterOfDisplayForWindow( | 104 GetCenterOfDisplayForWindow(wm_root_window, |
105 wm_root_window, GetMinimumBoundsHeightForAppList(view))); | 105 GetMinimumBoundsHeightForAppList(view)), |
106 ash::ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); | |
vadimt
2017/04/13 21:48:34
Please fix indentation
newcomer
2017/04/18 21:12:33
Done.
| |
106 | 107 |
107 keyboard::KeyboardController* keyboard_controller = | 108 keyboard::KeyboardController* keyboard_controller = |
108 keyboard::KeyboardController::GetInstance(); | 109 keyboard::KeyboardController::GetInstance(); |
109 if (keyboard_controller) | 110 if (keyboard_controller) |
110 keyboard_controller->AddObserver(this); | 111 keyboard_controller->AddObserver(this); |
111 Shell::Get()->AddPreTargetHandler(this); | 112 Shell::Get()->AddPreTargetHandler(this); |
112 WmShelf* shelf = WmShelf::ForWindow(wm_root_window); | 113 WmShelf* shelf = WmShelf::ForWindow(wm_root_window); |
113 shelf->AddObserver(this); | 114 shelf->AddObserver(this); |
114 | 115 |
115 // By setting us as DnD recipient, the app list knows that we can | 116 // By setting us as DnD recipient, the app list knows that we can |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 } | 240 } |
240 | 241 |
241 //////////////////////////////////////////////////////////////////////////////// | 242 //////////////////////////////////////////////////////////////////////////////// |
242 // AppListPresenterDelegate, WmShelfObserver implementation: | 243 // AppListPresenterDelegate, WmShelfObserver implementation: |
243 | 244 |
244 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { | 245 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { |
245 UpdateBounds(); | 246 UpdateBounds(); |
246 } | 247 } |
247 | 248 |
248 } // namespace ash | 249 } // namespace ash |
OLD | NEW |