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

Side by Side Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2911393002: Nix GetRootWindowController, use RootWindowController::ForWindow. (Closed)
Patch Set: Sync and rebase. Created 3 years, 6 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/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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 app_list::AppListViewDelegate* AppListPresenterDelegate::GetViewDelegate() { 83 app_list::AppListViewDelegate* AppListPresenterDelegate::GetViewDelegate() {
84 return view_delegate_factory_->GetDelegate(); 84 return view_delegate_factory_->GetDelegate();
85 } 85 }
86 86
87 void AppListPresenterDelegate::Init(app_list::AppListView* view, 87 void AppListPresenterDelegate::Init(app_list::AppListView* view,
88 int64_t display_id, 88 int64_t display_id,
89 int current_apps_page) { 89 int current_apps_page) {
90 // App list needs to know the new shelf layout in order to calculate its 90 // App list needs to know the new shelf layout in order to calculate its
91 // UI layout when AppListView visibility changes. 91 // UI layout when AppListView visibility changes.
92 ash::Shell::GetPrimaryRootWindowController() 92 Shell::GetPrimaryRootWindowController()
93 ->GetShelfLayoutManager() 93 ->GetShelfLayoutManager()
94 ->UpdateAutoHideState(); 94 ->UpdateAutoHideState();
95 view_ = view; 95 view_ = view;
96 aura::Window* root_window = 96 aura::Window* root_window =
97 ShellPort::Get()->GetRootWindowForDisplayId(display_id); 97 ShellPort::Get()->GetRootWindowForDisplayId(display_id);
98 aura::Window* container = GetRootWindowController(root_window) 98 aura::Window* container = RootWindowController::ForWindow(root_window)
99 ->GetContainer(kShellWindowId_AppListContainer); 99 ->GetContainer(kShellWindowId_AppListContainer);
100 100
101 view->Initialize(container, current_apps_page); 101 view->Initialize(container, current_apps_page);
102 102
103 if (!app_list::features::IsFullscreenAppListEnabled()) { 103 if (!app_list::features::IsFullscreenAppListEnabled()) {
104 view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow( 104 view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow(
105 root_window, GetMinimumBoundsHeightForAppList(view))); 105 root_window, GetMinimumBoundsHeightForAppList(view)));
106 } 106 }
107 keyboard::KeyboardController* keyboard_controller = 107 keyboard::KeyboardController* keyboard_controller =
108 keyboard::KeyboardController::GetInstance(); 108 keyboard::KeyboardController::GetInstance();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 void AppListPresenterDelegate::ProcessLocatedEvent(ui::LocatedEvent* event) { 179 void AppListPresenterDelegate::ProcessLocatedEvent(ui::LocatedEvent* event) {
180 if (!view_ || !is_visible_) 180 if (!view_ || !is_visible_)
181 return; 181 return;
182 182
183 // If the event happened on a menu, then the event should not close the app 183 // If the event happened on a menu, then the event should not close the app
184 // list. 184 // list.
185 aura::Window* target = static_cast<aura::Window*>(event->target()); 185 aura::Window* target = static_cast<aura::Window*>(event->target());
186 if (target) { 186 if (target) {
187 RootWindowController* root_controller = 187 RootWindowController* root_controller =
188 GetRootWindowController(target->GetRootWindow()); 188 RootWindowController::ForWindow(target);
189 if (root_controller) { 189 if (root_controller) {
190 aura::Window* menu_container = 190 aura::Window* menu_container =
191 root_controller->GetContainer(kShellWindowId_MenuContainer); 191 root_controller->GetContainer(kShellWindowId_MenuContainer);
192 if (menu_container->Contains(target)) 192 if (menu_container->Contains(target))
193 return; 193 return;
194 aura::Window* keyboard_container = root_controller->GetContainer( 194 aura::Window* keyboard_container = root_controller->GetContainer(
195 kShellWindowId_VirtualKeyboardContainer); 195 kShellWindowId_VirtualKeyboardContainer);
196 if (keyboard_container->Contains(target)) 196 if (keyboard_container->Contains(target))
197 return; 197 return;
198 } 198 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void AppListPresenterDelegate::OnKeyboardClosed() {} 230 void AppListPresenterDelegate::OnKeyboardClosed() {}
231 231
232 //////////////////////////////////////////////////////////////////////////////// 232 ////////////////////////////////////////////////////////////////////////////////
233 // AppListPresenterDelegate, ShellObserver implementation: 233 // AppListPresenterDelegate, ShellObserver implementation:
234 void AppListPresenterDelegate::OnOverviewModeStarting() { 234 void AppListPresenterDelegate::OnOverviewModeStarting() {
235 if (is_visible_) 235 if (is_visible_)
236 presenter_->Dismiss(); 236 presenter_->Dismiss();
237 } 237 }
238 238
239 } // namespace ash 239 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698