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

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

Issue 1901773002: Removes most of aura dependencies from DefaultState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wm_window_positioner
Patch Set: nit and merge Created 4 years, 8 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/wm/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_root_window_controller_aura.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/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/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
8 #include "ash/shell.h" 9 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
10 #include "ash/wm/aura/wm_window_aura.h" 11 #include "ash/wm/aura/wm_window_aura.h"
11 #include "ash/wm/mru_window_tracker.h" 12 #include "ash/wm/mru_window_tracker.h"
12 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
13 #include "ui/wm/public/activation_client.h" 14 #include "ui/wm/public/activation_client.h"
14 15
15 namespace ash { 16 namespace ash {
16 namespace wm { 17 namespace wm {
(...skipping 21 matching lines...) Expand all
38 WmGlobalsAura* WmGlobalsAura::Get() { 39 WmGlobalsAura* WmGlobalsAura::Get() {
39 if (!instance_) 40 if (!instance_)
40 new WmGlobalsAura; 41 new WmGlobalsAura;
41 return instance_; 42 return instance_;
42 } 43 }
43 44
44 WmWindow* WmGlobalsAura::GetActiveWindow() { 45 WmWindow* WmGlobalsAura::GetActiveWindow() {
45 return WmWindowAura::Get(wm::GetActiveWindow()); 46 return WmWindowAura::Get(wm::GetActiveWindow());
46 } 47 }
47 48
49 WmWindow* WmGlobalsAura::GetRootWindowForDisplayId(int64_t display_id) {
50 return WmWindowAura::Get(Shell::GetInstance()
51 ->window_tree_host_manager()
52 ->GetRootWindowForDisplayId(display_id));
53 }
54
48 WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() { 55 WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() {
49 return WmWindowAura::Get(Shell::GetTargetRootWindow()); 56 return WmWindowAura::Get(Shell::GetTargetRootWindow());
50 } 57 }
51 58
52 std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() { 59 std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() {
53 const std::vector<aura::Window*> windows = ash::Shell::GetInstance() 60 const std::vector<aura::Window*> windows = ash::Shell::GetInstance()
54 ->mru_window_tracker() 61 ->mru_window_tracker()
55 ->BuildWindowListIgnoreModal(); 62 ->BuildWindowListIgnoreModal();
56 std::vector<WmWindow*> wm_windows(windows.size()); 63 std::vector<WmWindow*> wm_windows(windows.size());
57 for (size_t i = 0; i < windows.size(); ++i) 64 for (size_t i = 0; i < windows.size(); ++i)
58 wm_windows[i] = WmWindowAura::Get(windows[i]); 65 wm_windows[i] = WmWindowAura::Get(windows[i]);
59 return wm_windows; 66 return wm_windows;
60 } 67 }
61 68
62 bool WmGlobalsAura::IsForceMaximizeOnFirstRun() { 69 bool WmGlobalsAura::IsForceMaximizeOnFirstRun() {
63 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); 70 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun();
64 } 71 }
65 72
66 std::vector<WmWindow*> WmGlobalsAura::GetAllRootWindows() { 73 std::vector<WmWindow*> WmGlobalsAura::GetAllRootWindows() {
67 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 74 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
68 std::vector<WmWindow*> wm_windows(root_windows.size()); 75 std::vector<WmWindow*> wm_windows(root_windows.size());
69 for (size_t i = 0; i < root_windows.size(); ++i) 76 for (size_t i = 0; i < root_windows.size(); ++i)
70 wm_windows[i] = WmWindowAura::Get(root_windows[i]); 77 wm_windows[i] = WmWindowAura::Get(root_windows[i]);
71 return wm_windows; 78 return wm_windows;
72 } 79 }
73 80
74 } // namespace wm 81 } // namespace wm
75 } // namespace ash 82 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_root_window_controller_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698