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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 bool WmWindowAura::IsSystemModal() const { | 284 bool WmWindowAura::IsSystemModal() const { |
285 return window_->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_SYSTEM; | 285 return window_->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_SYSTEM; |
286 } | 286 } |
287 | 287 |
288 bool WmWindowAura::GetBoolProperty(WmWindowProperty key) { | 288 bool WmWindowAura::GetBoolProperty(WmWindowProperty key) { |
289 switch (key) { | 289 switch (key) { |
290 case WmWindowProperty::DRAW_ATTENTION: | 290 case WmWindowProperty::DRAW_ATTENTION: |
291 return window_->GetProperty(aura::client::kDrawAttentionKey); | 291 return window_->GetProperty(aura::client::kDrawAttentionKey); |
292 | 292 |
| 293 case WmWindowProperty::PANEL_ATTACHED: |
| 294 return window_->GetProperty(kPanelAttachedKey); |
| 295 |
293 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY: | 296 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY: |
294 return window_->GetProperty(kSnapChildrenToPixelBoundary); | 297 return window_->GetProperty(kSnapChildrenToPixelBoundary); |
295 | 298 |
296 case WmWindowProperty::ALWAYS_ON_TOP: | 299 case WmWindowProperty::ALWAYS_ON_TOP: |
297 return window_->GetProperty(aura::client::kAlwaysOnTopKey); | 300 return window_->GetProperty(aura::client::kAlwaysOnTopKey); |
298 | 301 |
299 case WmWindowProperty::EXCLUDE_FROM_MRU: | 302 case WmWindowProperty::EXCLUDE_FROM_MRU: |
300 return window_->GetProperty(aura::client::kExcludeFromMruKey); | 303 return window_->GetProperty(aura::client::kExcludeFromMruKey); |
301 | 304 |
302 default: | 305 default: |
303 NOTREACHED(); | 306 NOTREACHED(); |
304 break; | 307 break; |
305 } | 308 } |
306 | 309 |
307 return false; | 310 return false; |
308 } | 311 } |
309 | 312 |
| 313 void WmWindowAura::SetBoolProperty(WmWindowProperty key, bool value) { |
| 314 switch (key) { |
| 315 case WmWindowProperty::PANEL_ATTACHED: |
| 316 window_->SetProperty(kPanelAttachedKey, value); |
| 317 break; |
| 318 default: |
| 319 NOTREACHED(); |
| 320 break; |
| 321 } |
| 322 } |
| 323 |
310 SkColor WmWindowAura::GetColorProperty(WmWindowProperty key) { | 324 SkColor WmWindowAura::GetColorProperty(WmWindowProperty key) { |
311 if (key == WmWindowProperty::TOP_VIEW_COLOR) | 325 if (key == WmWindowProperty::TOP_VIEW_COLOR) |
312 return window_->GetProperty(aura::client::kTopViewColor); | 326 return window_->GetProperty(aura::client::kTopViewColor); |
313 | 327 |
314 NOTREACHED(); | 328 NOTREACHED(); |
315 return 0; | 329 return 0; |
316 } | 330 } |
317 | 331 |
318 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { | 332 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { |
319 if (key == WmWindowProperty::TOP_VIEW_COLOR) { | 333 if (key == WmWindowProperty::TOP_VIEW_COLOR) { |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 if (key == aura::client::kAlwaysOnTopKey) { | 895 if (key == aura::client::kAlwaysOnTopKey) { |
882 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 896 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
883 } else if (key == aura::client::kAppIconKey) { | 897 } else if (key == aura::client::kAppIconKey) { |
884 wm_property = WmWindowProperty::APP_ICON; | 898 wm_property = WmWindowProperty::APP_ICON; |
885 } else if (key == aura::client::kDrawAttentionKey) { | 899 } else if (key == aura::client::kDrawAttentionKey) { |
886 wm_property = WmWindowProperty::DRAW_ATTENTION; | 900 wm_property = WmWindowProperty::DRAW_ATTENTION; |
887 } else if (key == aura::client::kExcludeFromMruKey) { | 901 } else if (key == aura::client::kExcludeFromMruKey) { |
888 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; | 902 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; |
889 } else if (key == aura::client::kModalKey) { | 903 } else if (key == aura::client::kModalKey) { |
890 wm_property = WmWindowProperty::MODAL_TYPE; | 904 wm_property = WmWindowProperty::MODAL_TYPE; |
| 905 } else if (key == kPanelAttachedKey) { |
| 906 wm_property = WmWindowProperty::PANEL_ATTACHED; |
891 } else if (key == kShelfIDKey) { | 907 } else if (key == kShelfIDKey) { |
892 wm_property = WmWindowProperty::SHELF_ID; | 908 wm_property = WmWindowProperty::SHELF_ID; |
893 } else if (key == kShelfItemTypeKey) { | 909 } else if (key == kShelfItemTypeKey) { |
894 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; | 910 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; |
895 } else if (key == kSnapChildrenToPixelBoundary) { | 911 } else if (key == kSnapChildrenToPixelBoundary) { |
896 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; | 912 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; |
897 } else if (key == aura::client::kTopViewInset) { | 913 } else if (key == aura::client::kTopViewInset) { |
898 wm_property = WmWindowProperty::TOP_VIEW_INSET; | 914 wm_property = WmWindowProperty::TOP_VIEW_INSET; |
899 } else if (key == aura::client::kWindowIconKey) { | 915 } else if (key == aura::client::kWindowIconKey) { |
900 wm_property = WmWindowProperty::WINDOW_ICON; | 916 wm_property = WmWindowProperty::WINDOW_ICON; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 observer.OnTransientChildAdded(this, Get(transient)); | 962 observer.OnTransientChildAdded(this, Get(transient)); |
947 } | 963 } |
948 | 964 |
949 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 965 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
950 aura::Window* transient) { | 966 aura::Window* transient) { |
951 for (auto& observer : transient_observers_) | 967 for (auto& observer : transient_observers_) |
952 observer.OnTransientChildRemoved(this, Get(transient)); | 968 observer.OnTransientChildRemoved(this, Get(transient)); |
953 } | 969 } |
954 | 970 |
955 } // namespace ash | 971 } // namespace ash |
OLD | NEW |