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

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

Issue 1943603002: Makes ash/wm/common a library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gyp 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 WmWindowAura::WmWindowAura(aura::Window* window) 70 WmWindowAura::WmWindowAura(aura::Window* window)
71 : window_(window), 71 : window_(window),
72 // Mirrors that of aura::Window. 72 // Mirrors that of aura::Window.
73 observers_(base::ObserverList<WmWindowObserver>::NOTIFY_EXISTING_ONLY) { 73 observers_(base::ObserverList<WmWindowObserver>::NOTIFY_EXISTING_ONLY) {
74 window_->AddObserver(this); 74 window_->AddObserver(this);
75 window_->SetProperty(kWmWindowKey, this); 75 window_->SetProperty(kWmWindowKey, this);
76 } 76 }
77 77
78 // static 78 // static
79 WmWindow* WmWindow::Get(views::Widget* widget) {
80 return WmWindowAura::Get(widget->GetNativeWindow());
81 }
82
83 // static
84 WmWindow* WmWindowAura::Get(aura::Window* window) { 79 WmWindow* WmWindowAura::Get(aura::Window* window) {
85 if (!window) 80 if (!window)
86 return nullptr; 81 return nullptr;
87 82
88 WmWindow* wm_window = window->GetProperty(kWmWindowKey); 83 WmWindow* wm_window = window->GetProperty(kWmWindowKey);
89 if (wm_window) 84 if (wm_window)
90 return wm_window; 85 return wm_window;
91 // WmWindowAura is owned by the aura::Window. 86 // WmWindowAura is owned by the aura::Window.
92 return new WmWindowAura(window); 87 return new WmWindowAura(window);
93 } 88 }
(...skipping 16 matching lines...) Expand all
110 const WmWindow* WmWindowAura::GetRootWindow() const { 105 const WmWindow* WmWindowAura::GetRootWindow() const {
111 return Get(window_->GetRootWindow()); 106 return Get(window_->GetRootWindow());
112 } 107 }
113 108
114 WmRootWindowController* WmWindowAura::GetRootWindowController() { 109 WmRootWindowController* WmWindowAura::GetRootWindowController() {
115 aura::Window* root = window_->GetRootWindow(); 110 aura::Window* root = window_->GetRootWindow();
116 return root ? WmRootWindowControllerAura::Get(root) : nullptr; 111 return root ? WmRootWindowControllerAura::Get(root) : nullptr;
117 } 112 }
118 113
119 WmGlobals* WmWindowAura::GetGlobals() const { 114 WmGlobals* WmWindowAura::GetGlobals() const {
120 return WmGlobalsAura::Get(); 115 return WmGlobals::Get();
121 } 116 }
122 117
123 void WmWindowAura::SetName(const std::string& name) { 118 void WmWindowAura::SetName(const std::string& name) {
124 window_->SetName(name); 119 window_->SetName(name);
125 } 120 }
126 121
127 void WmWindowAura::SetShellWindowId(int id) { 122 void WmWindowAura::SetShellWindowId(int id) {
128 window_->set_id(id); 123 window_->set_id(id);
129 } 124 }
130 125
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 } 560 }
566 561
567 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, 562 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
568 bool visible) { 563 bool visible) {
569 FOR_EACH_OBSERVER(WmWindowObserver, observers_, 564 FOR_EACH_OBSERVER(WmWindowObserver, observers_,
570 OnWindowVisibilityChanging(this, visible)); 565 OnWindowVisibilityChanging(this, visible));
571 } 566 }
572 567
573 } // namespace wm 568 } // namespace wm
574 } // namespace ash 569 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698