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

Side by Side Diff: ash/wm/aura/wm_globals_aura.cc

Issue 2012343002: Converts overview to use common ash types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 7 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 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/wm/aura/wm_globals_aura.h" 5 #include "ash/wm/aura/wm_globals_aura.h"
6 6
7 #include "ash/display/window_tree_host_manager.h" 7 #include "ash/display/window_tree_host_manager.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 WmWindow* WmGlobalsAura::GetFocusedWindow() { 43 WmWindow* WmGlobalsAura::GetFocusedWindow() {
44 return WmWindowAura::Get( 44 return WmWindowAura::Get(
45 aura::client::GetFocusClient(Shell::GetPrimaryRootWindow()) 45 aura::client::GetFocusClient(Shell::GetPrimaryRootWindow())
46 ->GetFocusedWindow()); 46 ->GetFocusedWindow());
47 } 47 }
48 48
49 WmWindow* WmGlobalsAura::GetActiveWindow() { 49 WmWindow* WmGlobalsAura::GetActiveWindow() {
50 return WmWindowAura::Get(wm::GetActiveWindow()); 50 return WmWindowAura::Get(wm::GetActiveWindow());
51 } 51 }
52 52
53 WmWindow* WmGlobalsAura::GetPrimaryRootWindow() {
54 return WmWindowAura::Get(Shell::GetPrimaryRootWindow());
55 }
56
53 WmWindow* WmGlobalsAura::GetRootWindowForDisplayId(int64_t display_id) { 57 WmWindow* WmGlobalsAura::GetRootWindowForDisplayId(int64_t display_id) {
54 return WmWindowAura::Get(Shell::GetInstance() 58 return WmWindowAura::Get(Shell::GetInstance()
55 ->window_tree_host_manager() 59 ->window_tree_host_manager()
56 ->GetRootWindowForDisplayId(display_id)); 60 ->GetRootWindowForDisplayId(display_id));
57 } 61 }
58 62
59 WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() { 63 WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() {
60 return WmWindowAura::Get(Shell::GetTargetRootWindow()); 64 return WmWindowAura::Get(Shell::GetTargetRootWindow());
61 } 65 }
62 66
67 std::vector<WmWindow*> WmGlobalsAura::GetMruWindowList() {
68 return WmWindowAura::FromAuraWindows(
69 ash::Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList());
James Cook 2016/05/27 00:02:50 nit: no need for ash:: here or below
sky 2016/05/27 03:18:03 Done.
70 }
71
63 std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() { 72 std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() {
64 const std::vector<aura::Window*> windows = ash::Shell::GetInstance() 73 return WmWindowAura::FromAuraWindows(ash::Shell::GetInstance()
65 ->mru_window_tracker() 74 ->mru_window_tracker()
66 ->BuildWindowListIgnoreModal(); 75 ->BuildWindowListIgnoreModal());
67 std::vector<WmWindow*> wm_windows(windows.size());
68 for (size_t i = 0; i < windows.size(); ++i)
69 wm_windows[i] = WmWindowAura::Get(windows[i]);
70 return wm_windows;
71 } 76 }
72 77
73 bool WmGlobalsAura::IsForceMaximizeOnFirstRun() { 78 bool WmGlobalsAura::IsForceMaximizeOnFirstRun() {
74 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); 79 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun();
75 } 80 }
76 81
77 bool WmGlobalsAura::IsUserSessionBlocked() { 82 bool WmGlobalsAura::IsUserSessionBlocked() {
78 return Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked(); 83 return Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked();
79 } 84 }
80 85
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 164
160 void WmGlobalsAura::OnWindowActivated( 165 void WmGlobalsAura::OnWindowActivated(
161 aura::client::ActivationChangeObserver::ActivationReason reason, 166 aura::client::ActivationChangeObserver::ActivationReason reason,
162 aura::Window* gained_active, 167 aura::Window* gained_active,
163 aura::Window* lost_active) { 168 aura::Window* lost_active) {
164 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, 169 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_,
165 OnWindowActivated(WmWindowAura::Get(gained_active), 170 OnWindowActivated(WmWindowAura::Get(gained_active),
166 WmWindowAura::Get(lost_active))); 171 WmWindowAura::Get(lost_active)));
167 } 172 }
168 173
174 void WmGlobalsAura::OnAttemptToReactivateWindow(aura::Window* request_active,
175 aura::Window* actual_active) {
176 FOR_EACH_OBSERVER(
177 WmActivationObserver, activation_observers_,
178 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active),
179 WmWindowAura::Get(actual_active)));
180 }
181
169 void WmGlobalsAura::OnDisplayConfigurationChanging() { 182 void WmGlobalsAura::OnDisplayConfigurationChanging() {
170 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 183 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
171 OnDisplayConfigurationChanging()); 184 OnDisplayConfigurationChanging());
172 } 185 }
173 186
174 void WmGlobalsAura::OnDisplayConfigurationChanged() { 187 void WmGlobalsAura::OnDisplayConfigurationChanged() {
175 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 188 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
176 OnDisplayConfigurationChanged()); 189 OnDisplayConfigurationChanged());
177 } 190 }
178 191
179 void WmGlobalsAura::OnOverviewModeEnded() { 192 void WmGlobalsAura::OnOverviewModeEnded() {
180 FOR_EACH_OBSERVER(WmOverviewModeObserver, overview_mode_observers_, 193 FOR_EACH_OBSERVER(WmOverviewModeObserver, overview_mode_observers_,
181 OnOverviewModeEnded()); 194 OnOverviewModeEnded());
182 } 195 }
183 196
184 } // namespace wm 197 } // namespace wm
185 } // namespace ash 198 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698