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

Side by Side Diff: ash/wm/aura/wm_window_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_window_aura.h ('k') | ash/wm/common/window_animation_types.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_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/wm/aura/wm_globals_aura.h" 8 #include "ash/wm/aura/wm_globals_aura.h"
9 #include "ash/wm/aura/wm_root_window_controller_aura.h" 9 #include "ash/wm/aura/wm_root_window_controller_aura.h"
10 #include "ash/wm/common/wm_window_observer.h" 10 #include "ash/wm/common/wm_window_observer.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 const WindowState* WmWindowAura::GetWindowState() const { 185 const WindowState* WmWindowAura::GetWindowState() const {
186 return ash::wm::GetWindowState(window_); 186 return ash::wm::GetWindowState(window_);
187 } 187 }
188 188
189 WmWindow* WmWindowAura::GetToplevelWindow() { 189 WmWindow* WmWindowAura::GetToplevelWindow() {
190 return Get(window_->GetToplevelWindow()); 190 return Get(window_->GetToplevelWindow());
191 } 191 }
192 192
193 void WmWindowAura::AddChild(WmWindow* window) {
194 window_->AddChild(GetAuraWindow(window));
195 }
196
193 WmWindow* WmWindowAura::GetParent() { 197 WmWindow* WmWindowAura::GetParent() {
194 return Get(window_->parent()); 198 return Get(window_->parent());
195 } 199 }
196 200
197 WmWindow* WmWindowAura::GetTransientParent() { 201 WmWindow* WmWindowAura::GetTransientParent() {
198 return Get(::wm::GetTransientParent(window_)); 202 return Get(::wm::GetTransientParent(window_));
199 } 203 }
200 204
201 std::vector<WmWindow*> WmWindowAura::GetTransientChildren() { 205 std::vector<WmWindow*> WmWindowAura::GetTransientChildren() {
202 const std::vector<aura::Window*> aura_windows( 206 const std::vector<aura::Window*> aura_windows(
203 ::wm::GetTransientChildren(window_)); 207 ::wm::GetTransientChildren(window_));
204 std::vector<WmWindow*> wm_windows(aura_windows.size()); 208 std::vector<WmWindow*> wm_windows(aura_windows.size());
205 for (size_t i = 0; i < aura_windows.size(); ++i) 209 for (size_t i = 0; i < aura_windows.size(); ++i)
206 wm_windows[i] = Get(aura_windows[i]); 210 wm_windows[i] = Get(aura_windows[i]);
207 return wm_windows; 211 return wm_windows;
208 } 212 }
209 213
214 void WmWindowAura::SetVisibilityAnimationType(int type) {
215 ::wm::SetWindowVisibilityAnimationType(window_, type);
216 }
217
218 void WmWindowAura::Animate(::wm::WindowAnimationType type) {
219 ::wm::AnimateWindow(window_, type);
220 }
221
210 void WmWindowAura::SetBounds(const gfx::Rect& bounds) { 222 void WmWindowAura::SetBounds(const gfx::Rect& bounds) {
211 window_->SetBounds(bounds); 223 window_->SetBounds(bounds);
212 } 224 }
213 225
214 void WmWindowAura::SetBoundsWithTransitionDelay(const gfx::Rect& bounds, 226 void WmWindowAura::SetBoundsWithTransitionDelay(const gfx::Rect& bounds,
215 base::TimeDelta delta) { 227 base::TimeDelta delta) {
216 if (::wm::WindowAnimationsDisabled(window_)) { 228 if (::wm::WindowAnimationsDisabled(window_)) {
217 window_->SetBounds(bounds); 229 window_->SetBounds(bounds);
218 return; 230 return;
219 } 231 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 320 }
309 321
310 void WmWindowAura::SetShowState(ui::WindowShowState show_state) { 322 void WmWindowAura::SetShowState(ui::WindowShowState show_state) {
311 window_->SetProperty(aura::client::kShowStateKey, show_state); 323 window_->SetProperty(aura::client::kShowStateKey, show_state);
312 } 324 }
313 325
314 ui::WindowShowState WmWindowAura::GetShowState() const { 326 ui::WindowShowState WmWindowAura::GetShowState() const {
315 return window_->GetProperty(aura::client::kShowStateKey); 327 return window_->GetProperty(aura::client::kShowStateKey);
316 } 328 }
317 329
330 void WmWindowAura::SetRestoreShowState(ui::WindowShowState show_state) {
331 window_->SetProperty(aura::client::kRestoreShowStateKey, show_state);
332 }
333
318 void WmWindowAura::SetCapture() { 334 void WmWindowAura::SetCapture() {
319 window_->SetCapture(); 335 window_->SetCapture();
320 } 336 }
321 337
322 bool WmWindowAura::HasCapture() { 338 bool WmWindowAura::HasCapture() {
323 return window_->HasCapture(); 339 return window_->HasCapture();
324 } 340 }
325 341
326 void WmWindowAura::ReleaseCapture() { 342 void WmWindowAura::ReleaseCapture() {
327 window_->ReleaseCapture(); 343 window_->ReleaseCapture();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 FOR_EACH_OBSERVER(WmWindowObserver, observers_, 483 FOR_EACH_OBSERVER(WmWindowObserver, observers_,
468 OnWindowBoundsChanged(this, old_bounds, new_bounds)); 484 OnWindowBoundsChanged(this, old_bounds, new_bounds));
469 } 485 }
470 486
471 void WmWindowAura::OnWindowDestroying(aura::Window* window) { 487 void WmWindowAura::OnWindowDestroying(aura::Window* window) {
472 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); 488 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this));
473 } 489 }
474 490
475 } // namespace wm 491 } // namespace wm
476 } // namespace ash 492 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/aura/wm_window_aura.h ('k') | ash/wm/common/window_animation_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698