| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { | 299 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { |
| 300 if (key == WmWindowProperty::TOP_VIEW_COLOR) { | 300 if (key == WmWindowProperty::TOP_VIEW_COLOR) { |
| 301 window_->SetProperty(aura::client::kTopViewColor, value); | 301 window_->SetProperty(aura::client::kTopViewColor, value); |
| 302 return; | 302 return; |
| 303 } | 303 } |
| 304 | 304 |
| 305 NOTREACHED(); | 305 NOTREACHED(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 int WmWindowAura::GetIntProperty(WmWindowProperty key) { | 308 int WmWindowAura::GetIntProperty(WmWindowProperty key) { |
| 309 if (key == WmWindowProperty::MODAL_TYPE) |
| 310 return window_->GetProperty(aura::client::kModalKey); |
| 311 |
| 309 if (key == WmWindowProperty::SHELF_ID) | 312 if (key == WmWindowProperty::SHELF_ID) |
| 310 return GetShelfIDForWindow(window_); | 313 return GetShelfIDForWindow(window_); |
| 311 | 314 |
| 312 if (key == WmWindowProperty::TOP_VIEW_INSET) | 315 if (key == WmWindowProperty::TOP_VIEW_INSET) |
| 313 return window_->GetProperty(aura::client::kTopViewInset); | 316 return window_->GetProperty(aura::client::kTopViewInset); |
| 314 | 317 |
| 315 NOTREACHED(); | 318 NOTREACHED(); |
| 316 return 0; | 319 return 0; |
| 317 } | 320 } |
| 318 | 321 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 } | 794 } |
| 792 | 795 |
| 793 void WmWindowAura::OnWindowPropertyChanged(aura::Window* window, | 796 void WmWindowAura::OnWindowPropertyChanged(aura::Window* window, |
| 794 const void* key, | 797 const void* key, |
| 795 intptr_t old) { | 798 intptr_t old) { |
| 796 if (key == aura::client::kShowStateKey) { | 799 if (key == aura::client::kShowStateKey) { |
| 797 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); | 800 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); |
| 798 return; | 801 return; |
| 799 } | 802 } |
| 800 WmWindowProperty wm_property; | 803 WmWindowProperty wm_property; |
| 801 if (key == kSnapChildrenToPixelBoundary) { | 804 if (key == aura::client::kAlwaysOnTopKey) { |
| 802 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; | |
| 803 } else if (key == aura::client::kAlwaysOnTopKey) { | |
| 804 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 805 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
| 806 } else if (key == aura::client::kExcludeFromMruKey) { |
| 807 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; |
| 808 } else if (key == aura::client::kModalKey) { |
| 809 wm_property = WmWindowProperty::MODAL_TYPE; |
| 805 } else if (key == kShelfID) { | 810 } else if (key == kShelfID) { |
| 806 wm_property = WmWindowProperty::SHELF_ID; | 811 wm_property = WmWindowProperty::SHELF_ID; |
| 807 } else if (key == kShelfItemDetailsKey) { | 812 } else if (key == kShelfItemDetailsKey) { |
| 808 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS; | 813 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS; |
| 814 } else if (key == kSnapChildrenToPixelBoundary) { |
| 815 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; |
| 809 } else if (key == aura::client::kTopViewInset) { | 816 } else if (key == aura::client::kTopViewInset) { |
| 810 wm_property = WmWindowProperty::TOP_VIEW_INSET; | 817 wm_property = WmWindowProperty::TOP_VIEW_INSET; |
| 811 } else if (key == aura::client::kExcludeFromMruKey) { | |
| 812 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; | |
| 813 } else { | 818 } else { |
| 814 return; | 819 return; |
| 815 } | 820 } |
| 816 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 821 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 817 OnWindowPropertyChanged(this, wm_property)); | 822 OnWindowPropertyChanged(this, wm_property)); |
| 818 } | 823 } |
| 819 | 824 |
| 820 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, | 825 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, |
| 821 const gfx::Rect& old_bounds, | 826 const gfx::Rect& old_bounds, |
| 822 const gfx::Rect& new_bounds) { | 827 const gfx::Rect& new_bounds) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 OnTransientChildAdded(this, Get(transient))); | 859 OnTransientChildAdded(this, Get(transient))); |
| 855 } | 860 } |
| 856 | 861 |
| 857 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 862 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
| 858 aura::Window* transient) { | 863 aura::Window* transient) { |
| 859 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 864 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
| 860 OnTransientChildRemoved(this, Get(transient))); | 865 OnTransientChildRemoved(this, Get(transient))); |
| 861 } | 866 } |
| 862 | 867 |
| 863 } // namespace ash | 868 } // namespace ash |
| OLD | NEW |