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

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

Issue 1923983003: Makes WorkspaceLayoutManager use ash/wm/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix always-on-top and remove mus changes 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_window_aura.h" 5 #include "ash/wm/aura/wm_window_aura.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shelf/shelf_util.h" 8 #include "ash/shelf/shelf_util.h"
9 #include "ash/wm/aura/aura_layout_manager_adapter.h" 9 #include "ash/wm/aura/aura_layout_manager_adapter.h"
10 #include "ash/wm/aura/wm_globals_aura.h" 10 #include "ash/wm/aura/wm_globals_aura.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void SetBounds(aura::Window* window, const gfx::Rect& bounds) { 60 void SetBounds(aura::Window* window, const gfx::Rect& bounds) {
61 SetChildBoundsDirect(window, bounds); 61 SetChildBoundsDirect(window, bounds);
62 } 62 }
63 63
64 private: 64 private:
65 DISALLOW_COPY_AND_ASSIGN(BoundsSetter); 65 DISALLOW_COPY_AND_ASSIGN(BoundsSetter);
66 }; 66 };
67 67
68 } // namespace 68 } // namespace
69 69
70 WmWindowAura::WmWindowAura(aura::Window* window) : window_(window) { 70 WmWindowAura::WmWindowAura(aura::Window* window)
71 : window_(window),
72 // Mirrors that of aura::Window.
73 observers_(base::ObserverList<WmWindowObserver>::NOTIFY_EXISTING_ONLY) {
71 window_->AddObserver(this); 74 window_->AddObserver(this);
72 window_->SetProperty(kWmWindowKey, this); 75 window_->SetProperty(kWmWindowKey, this);
73 } 76 }
74 77
75 // static 78 // static
76 WmWindow* WmWindow::Get(views::Widget* widget) { 79 WmWindow* WmWindow::Get(views::Widget* widget) {
77 return WmWindowAura::Get(widget->GetNativeWindow()); 80 return WmWindowAura::Get(widget->GetNativeWindow());
78 } 81 }
79 82
80 // static 83 // static
(...skipping 12 matching lines...) Expand all
93 std::vector<WmWindow*> WmWindowAura::FromAuraWindows( 96 std::vector<WmWindow*> WmWindowAura::FromAuraWindows(
94 const std::vector<aura::Window*>& aura_windows) { 97 const std::vector<aura::Window*>& aura_windows) {
95 std::vector<WmWindow*> result(aura_windows.size()); 98 std::vector<WmWindow*> result(aura_windows.size());
96 for (size_t i = 0; i < aura_windows.size(); ++i) 99 for (size_t i = 0; i < aura_windows.size(); ++i)
97 result[i] = Get(aura_windows[i]); 100 result[i] = Get(aura_windows[i]);
98 return result; 101 return result;
99 } 102 }
100 103
101 // static 104 // static
102 const aura::Window* WmWindowAura::GetAuraWindow(const WmWindow* wm_window) { 105 const aura::Window* WmWindowAura::GetAuraWindow(const WmWindow* wm_window) {
103 return static_cast<const WmWindowAura*>(wm_window)->aura_window(); 106 return wm_window ? static_cast<const WmWindowAura*>(wm_window)->aura_window()
107 : nullptr;
104 } 108 }
105 109
106 const WmWindow* WmWindowAura::GetRootWindow() const { 110 const WmWindow* WmWindowAura::GetRootWindow() const {
107 return Get(window_->GetRootWindow()); 111 return Get(window_->GetRootWindow());
108 } 112 }
109 113
110 WmRootWindowController* WmWindowAura::GetRootWindowController() { 114 WmRootWindowController* WmWindowAura::GetRootWindowController() {
111 aura::Window* root = window_->GetRootWindow(); 115 aura::Window* root = window_->GetRootWindow();
112 return root ? WmRootWindowControllerAura::Get(root) : nullptr; 116 return root ? WmRootWindowControllerAura::Get(root) : nullptr;
113 } 117 }
114 118
115 WmGlobals* WmWindowAura::GetGlobals() const { 119 WmGlobals* WmWindowAura::GetGlobals() const {
116 return WmGlobalsAura::Get(); 120 return WmGlobalsAura::Get();
117 } 121 }
118 122
119 void WmWindowAura::SetName(const std::string& name) { 123 void WmWindowAura::SetName(const std::string& name) {
120 window_->SetName(name); 124 window_->SetName(name);
121 } 125 }
122 126
123 void WmWindowAura::SetShellWindowId(int id) { 127 void WmWindowAura::SetShellWindowId(int id) {
124 window_->set_id(id); 128 window_->set_id(id);
125 } 129 }
126 130
127 int WmWindowAura::GetShellWindowId() { 131 int WmWindowAura::GetShellWindowId() const {
128 return window_->id(); 132 return window_->id();
129 } 133 }
130 134
131 ui::wm::WindowType WmWindowAura::GetType() const { 135 ui::wm::WindowType WmWindowAura::GetType() const {
132 return window_->type(); 136 return window_->type();
133 } 137 }
134 138
135 ui::Layer* WmWindowAura::GetLayer() { 139 ui::Layer* WmWindowAura::GetLayer() {
136 return window_->layer(); 140 return window_->layer();
137 } 141 }
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 565 }
562 566
563 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, 567 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
564 bool visible) { 568 bool visible) {
565 FOR_EACH_OBSERVER(WmWindowObserver, observers_, 569 FOR_EACH_OBSERVER(WmWindowObserver, observers_,
566 OnWindowVisibilityChanging(this, visible)); 570 OnWindowVisibilityChanging(this, visible));
567 } 571 }
568 572
569 } // namespace wm 573 } // namespace wm
570 } // namespace ash 574 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698