Chromium Code Reviews| 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" |
| (...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 WmShell::Get()->GetRootWindowForDisplayId(display_id); | 98 WmShell::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->InitializeWindow( |
|
vadimt
2017/04/10 19:40:10
Please talk to Now people (I'll provide contacts)
newcomer
2017/04/13 21:13:59
We are waiting to hear back from travis.
| |
| 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)), |
|
newcomer
2017/04/10 16:43:22
Moved view->SetAnchorPoint into the Initialize Win
| |
| 106 ash::ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); | |
| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 } | 239 } |
| 239 | 240 |
| 240 //////////////////////////////////////////////////////////////////////////////// | 241 //////////////////////////////////////////////////////////////////////////////// |
| 241 // AppListPresenterDelegate, WmShelfObserver implementation: | 242 // AppListPresenterDelegate, WmShelfObserver implementation: |
| 242 | 243 |
| 243 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { | 244 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { |
| 244 UpdateBounds(); | 245 UpdateBounds(); |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace ash | 248 } // namespace ash |
| OLD | NEW |