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

Side by Side Diff: ash/aura/wm_shell_aura.cc

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 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
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/scoped_root_window_for_new_windows.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/aura/wm_shell_aura.h" 5 #include "ash/aura/wm_shell_aura.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 WmWindow* WmShellAura::GetPrimaryRootWindow() { 80 WmWindow* WmShellAura::GetPrimaryRootWindow() {
81 return WmWindowAura::Get(Shell::GetPrimaryRootWindow()); 81 return WmWindowAura::Get(Shell::GetPrimaryRootWindow());
82 } 82 }
83 83
84 WmWindow* WmShellAura::GetRootWindowForDisplayId(int64_t display_id) { 84 WmWindow* WmShellAura::GetRootWindowForDisplayId(int64_t display_id) {
85 return WmWindowAura::Get(Shell::GetInstance() 85 return WmWindowAura::Get(Shell::GetInstance()
86 ->window_tree_host_manager() 86 ->window_tree_host_manager()
87 ->GetRootWindowForDisplayId(display_id)); 87 ->GetRootWindowForDisplayId(display_id));
88 } 88 }
89 89
90 WmWindow* WmShellAura::GetRootWindowForNewWindows() {
91 return WmWindowAura::Get(Shell::GetTargetRootWindow());
92 }
93
94 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const { 90 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const {
95 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id); 91 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id);
96 } 92 }
97 93
98 bool WmShellAura::IsActiveDisplayId(int64_t display_id) const { 94 bool WmShellAura::IsActiveDisplayId(int64_t display_id) const {
99 return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id); 95 return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id);
100 } 96 }
101 97
102 bool WmShellAura::IsForceMaximizeOnFirstRun() { 98 bool WmShellAura::IsForceMaximizeOnFirstRun() {
103 return delegate()->IsForceMaximizeOnFirstRun(); 99 return delegate()->IsForceMaximizeOnFirstRun();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 Shell::GetInstance() 219 Shell::GetInstance()
224 ->virtual_keyboard_controller() 220 ->virtual_keyboard_controller()
225 ->ToggleIgnoreExternalKeyboard(); 221 ->ToggleIgnoreExternalKeyboard();
226 } 222 }
227 #endif 223 #endif
228 224
229 void WmShellAura::OnWindowActivated( 225 void WmShellAura::OnWindowActivated(
230 aura::client::ActivationChangeObserver::ActivationReason reason, 226 aura::client::ActivationChangeObserver::ActivationReason reason,
231 aura::Window* gained_active, 227 aura::Window* gained_active,
232 aura::Window* lost_active) { 228 aura::Window* lost_active) {
229 WmWindow* gained_active_wm = WmWindowAura::Get(gained_active);
230 WmWindow* lost_active_wm = WmWindowAura::Get(lost_active);
231 if (gained_active_wm)
232 set_root_window_for_new_windows(gained_active_wm->GetRootWindow());
233 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, 233 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_,
234 OnWindowActivated(WmWindowAura::Get(gained_active), 234 OnWindowActivated(gained_active_wm, lost_active_wm));
235 WmWindowAura::Get(lost_active)));
236 } 235 }
237 236
238 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active, 237 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active,
239 aura::Window* actual_active) { 238 aura::Window* actual_active) {
240 FOR_EACH_OBSERVER( 239 FOR_EACH_OBSERVER(
241 WmActivationObserver, activation_observers_, 240 WmActivationObserver, activation_observers_,
242 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active), 241 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active),
243 WmWindowAura::Get(actual_active))); 242 WmWindowAura::Get(actual_active)));
244 } 243 }
245 244
246 void WmShellAura::OnDisplayConfigurationChanging() { 245 void WmShellAura::OnDisplayConfigurationChanging() {
247 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 246 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
248 OnDisplayConfigurationChanging()); 247 OnDisplayConfigurationChanging());
249 } 248 }
250 249
251 void WmShellAura::OnDisplayConfigurationChanged() { 250 void WmShellAura::OnDisplayConfigurationChanged() {
252 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 251 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
253 OnDisplayConfigurationChanged()); 252 OnDisplayConfigurationChanged());
254 } 253 }
255 254
256 } // namespace ash 255 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/scoped_root_window_for_new_windows.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698