| OLD | NEW |
| 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/wm/aura/aura_layout_manager_adapter.h" | 9 #include "ash/wm/aura/aura_layout_manager_adapter.h" |
| 9 #include "ash/wm/aura/wm_globals_aura.h" | 10 #include "ash/wm/aura/wm_globals_aura.h" |
| 10 #include "ash/wm/aura/wm_root_window_controller_aura.h" | 11 #include "ash/wm/aura/wm_root_window_controller_aura.h" |
| 11 #include "ash/wm/common/wm_layout_manager.h" | 12 #include "ash/wm/common/wm_layout_manager.h" |
| 12 #include "ash/wm/common/wm_window_observer.h" | 13 #include "ash/wm/common/wm_window_observer.h" |
| 13 #include "ash/wm/common/wm_window_property.h" | 14 #include "ash/wm/common/wm_window_property.h" |
| 14 #include "ash/wm/window_animations.h" | 15 #include "ash/wm/window_animations.h" |
| 15 #include "ash/wm/window_properties.h" | 16 #include "ash/wm/window_properties.h" |
| 16 #include "ash/wm/window_state.h" | 17 #include "ash/wm/window_state.h" |
| 17 #include "ash/wm/window_state_aura.h" | 18 #include "ash/wm/window_state_aura.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return window_->IsVisible(); | 195 return window_->IsVisible(); |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool WmWindowAura::GetBoolProperty(WmWindowProperty key) { | 198 bool WmWindowAura::GetBoolProperty(WmWindowProperty key) { |
| 198 switch (key) { | 199 switch (key) { |
| 199 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUDARY: | 200 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUDARY: |
| 200 return window_->GetProperty(kSnapChildrenToPixelBoundary); | 201 return window_->GetProperty(kSnapChildrenToPixelBoundary); |
| 201 | 202 |
| 202 case WmWindowProperty::ALWAYS_ON_TOP: | 203 case WmWindowProperty::ALWAYS_ON_TOP: |
| 203 return window_->GetProperty(aura::client::kAlwaysOnTopKey); | 204 return window_->GetProperty(aura::client::kAlwaysOnTopKey); |
| 205 |
| 206 default: |
| 207 NOTREACHED(); |
| 208 break; |
| 204 } | 209 } |
| 205 | 210 |
| 211 return false; |
| 212 } |
| 213 |
| 214 int WmWindowAura::GetIntProperty(WmWindowProperty key) { |
| 215 if (key == WmWindowProperty::SHELF_ID) |
| 216 return GetShelfIDForWindow(window_); |
| 217 |
| 206 NOTREACHED(); | 218 NOTREACHED(); |
| 207 return false; | 219 return 0; |
| 208 } | 220 } |
| 209 | 221 |
| 210 const WindowState* WmWindowAura::GetWindowState() const { | 222 const WindowState* WmWindowAura::GetWindowState() const { |
| 211 return ash::wm::GetWindowState(window_); | 223 return ash::wm::GetWindowState(window_); |
| 212 } | 224 } |
| 213 | 225 |
| 214 WmWindow* WmWindowAura::GetToplevelWindow() { | 226 WmWindow* WmWindowAura::GetToplevelWindow() { |
| 215 return Get(window_->GetToplevelWindow()); | 227 return Get(window_->GetToplevelWindow()); |
| 216 } | 228 } |
| 217 | 229 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 intptr_t old) { | 529 intptr_t old) { |
| 518 if (key == aura::client::kShowStateKey) { | 530 if (key == aura::client::kShowStateKey) { |
| 519 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); | 531 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); |
| 520 return; | 532 return; |
| 521 } | 533 } |
| 522 WmWindowProperty wm_property; | 534 WmWindowProperty wm_property; |
| 523 if (key == kSnapChildrenToPixelBoundary) { | 535 if (key == kSnapChildrenToPixelBoundary) { |
| 524 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUDARY; | 536 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUDARY; |
| 525 } else if (key == aura::client::kAlwaysOnTopKey) { | 537 } else if (key == aura::client::kAlwaysOnTopKey) { |
| 526 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 538 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
| 539 } else if (key == kShelfID) { |
| 540 wm_property = WmWindowProperty::SHELF_ID; |
| 527 } else { | 541 } else { |
| 528 return; | 542 return; |
| 529 } | 543 } |
| 530 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 544 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 531 OnWindowPropertyChanged(this, wm_property, old)); | 545 OnWindowPropertyChanged(this, wm_property, old)); |
| 532 } | 546 } |
| 533 | 547 |
| 534 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, | 548 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, |
| 535 const gfx::Rect& old_bounds, | 549 const gfx::Rect& old_bounds, |
| 536 const gfx::Rect& new_bounds) { | 550 const gfx::Rect& new_bounds) { |
| 537 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 551 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 538 OnWindowBoundsChanged(this, old_bounds, new_bounds)); | 552 OnWindowBoundsChanged(this, old_bounds, new_bounds)); |
| 539 } | 553 } |
| 540 | 554 |
| 541 void WmWindowAura::OnWindowDestroying(aura::Window* window) { | 555 void WmWindowAura::OnWindowDestroying(aura::Window* window) { |
| 542 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); | 556 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); |
| 543 } | 557 } |
| 544 | 558 |
| 545 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, | 559 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, |
| 546 bool visible) { | 560 bool visible) { |
| 547 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 561 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 548 OnWindowVisibilityChanging(this, visible)); | 562 OnWindowVisibilityChanging(this, visible)); |
| 549 } | 563 } |
| 550 | 564 |
| 551 } // namespace wm | 565 } // namespace wm |
| 552 } // namespace ash | 566 } // namespace ash |
| OLD | NEW |