Chromium Code Reviews| 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/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
| 6 | 6 |
| 7 #include "ash/aura/aura_layout_manager_adapter.h" | 7 #include "ash/aura/aura_layout_manager_adapter.h" |
| 8 #include "ash/aura/wm_root_window_controller_aura.h" | 8 #include "ash/aura/wm_root_window_controller_aura.h" |
| 9 #include "ash/aura/wm_shell_aura.h" | 9 #include "ash/aura/wm_shell_aura.h" |
| 10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 return false; | 284 return false; |
| 285 } | 285 } |
| 286 | 286 |
| 287 int WmWindowAura::GetIntProperty(WmWindowProperty key) { | 287 int WmWindowAura::GetIntProperty(WmWindowProperty key) { |
| 288 if (key == WmWindowProperty::SHELF_ID) | 288 if (key == WmWindowProperty::SHELF_ID) |
| 289 return GetShelfIDForWindow(window_); | 289 return GetShelfIDForWindow(window_); |
| 290 | 290 |
| 291 if (key == WmWindowProperty::TOP_VIEW_INSET) | 291 if (key == WmWindowProperty::TOP_VIEW_INSET) |
| 292 return window_->GetProperty(aura::client::kTopViewInset); | 292 return window_->GetProperty(aura::client::kTopViewInset); |
| 293 | 293 |
| 294 if (key == WmWindowProperty::MODAL_TYPE) | |
| 295 return window_->GetProperty(aura::client::kModalKey); | |
| 296 | |
| 294 NOTREACHED(); | 297 NOTREACHED(); |
| 295 return 0; | 298 return 0; |
| 296 } | 299 } |
| 297 | 300 |
| 298 void WmWindowAura::SetIntProperty(WmWindowProperty key, int value) { | 301 void WmWindowAura::SetIntProperty(WmWindowProperty key, int value) { |
| 299 if (key == WmWindowProperty::SHELF_ID) { | 302 if (key == WmWindowProperty::SHELF_ID) { |
| 300 SetShelfIDForWindow(value, window_); | 303 SetShelfIDForWindow(value, window_); |
| 301 return; | 304 return; |
| 302 } | 305 } |
| 303 if (key == WmWindowProperty::TOP_VIEW_INSET) { | 306 if (key == WmWindowProperty::TOP_VIEW_INSET) { |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 782 } else if (key == aura::client::kAlwaysOnTopKey) { | 785 } else if (key == aura::client::kAlwaysOnTopKey) { |
| 783 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 786 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
| 784 } else if (key == kShelfID) { | 787 } else if (key == kShelfID) { |
| 785 wm_property = WmWindowProperty::SHELF_ID; | 788 wm_property = WmWindowProperty::SHELF_ID; |
| 786 } else if (key == kShelfItemDetailsKey) { | 789 } else if (key == kShelfItemDetailsKey) { |
| 787 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS; | 790 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS; |
| 788 } else if (key == aura::client::kTopViewInset) { | 791 } else if (key == aura::client::kTopViewInset) { |
| 789 wm_property = WmWindowProperty::TOP_VIEW_INSET; | 792 wm_property = WmWindowProperty::TOP_VIEW_INSET; |
| 790 } else if (key == aura::client::kExcludeFromMruKey) { | 793 } else if (key == aura::client::kExcludeFromMruKey) { |
| 791 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; | 794 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; |
| 795 } else if (key == aura::client::kModalKey) { | |
| 796 wm_property = WmWindowProperty::MODAL_TYPE; | |
|
James Cook
2016/09/12 19:24:28
optional: You could sort all these ifs() too, whic
sky
2016/09/12 20:46:54
Done.
| |
| 792 } else { | 797 } else { |
| 793 return; | 798 return; |
| 794 } | 799 } |
| 795 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 800 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 796 OnWindowPropertyChanged(this, wm_property)); | 801 OnWindowPropertyChanged(this, wm_property)); |
| 797 } | 802 } |
| 798 | 803 |
| 799 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, | 804 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, |
| 800 const gfx::Rect& old_bounds, | 805 const gfx::Rect& old_bounds, |
| 801 const gfx::Rect& new_bounds) { | 806 const gfx::Rect& new_bounds) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 833 OnTransientChildAdded(this, Get(transient))); | 838 OnTransientChildAdded(this, Get(transient))); |
| 834 } | 839 } |
| 835 | 840 |
| 836 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 841 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
| 837 aura::Window* transient) { | 842 aura::Window* transient) { |
| 838 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 843 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
| 839 OnTransientChildRemoved(this, Get(transient))); | 844 OnTransientChildRemoved(this, Get(transient))); |
| 840 } | 845 } |
| 841 | 846 |
| 842 } // namespace ash | 847 } // namespace ash |
| OLD | NEW |