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) { | |
sky
2016/12/08 00:38:54
Do we really need to set all these properties? I b
msw
2016/12/08 20:31:36
Reduced to just panel_attached; I was just matchin
| |
314 switch (key) { | |
315 case WmWindowProperty::DRAW_ATTENTION: | |
316 window_->SetProperty(aura::client::kDrawAttentionKey, value); | |
sky
2016/12/08 00:38:54
I am tempted to say you should just route through
msw
2016/12/08 20:31:36
We need lots of ash/common cleanup... I'd opt to l
| |
317 break; | |
318 case WmWindowProperty::PANEL_ATTACHED: | |
319 window_->SetProperty(kPanelAttachedKey, value); | |
320 break; | |
321 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY: | |
322 window_->SetProperty(kSnapChildrenToPixelBoundary, value); | |
323 break; | |
324 case WmWindowProperty::ALWAYS_ON_TOP: | |
325 window_->SetProperty(aura::client::kAlwaysOnTopKey, value); | |
326 break; | |
327 case WmWindowProperty::EXCLUDE_FROM_MRU: | |
328 window_->SetProperty(aura::client::kExcludeFromMruKey, value); | |
329 break; | |
330 default: | |
331 NOTREACHED(); | |
332 break; | |
333 } | |
334 } | |
335 | |
310 SkColor WmWindowAura::GetColorProperty(WmWindowProperty key) { | 336 SkColor WmWindowAura::GetColorProperty(WmWindowProperty key) { |
311 if (key == WmWindowProperty::TOP_VIEW_COLOR) | 337 if (key == WmWindowProperty::TOP_VIEW_COLOR) |
312 return window_->GetProperty(aura::client::kTopViewColor); | 338 return window_->GetProperty(aura::client::kTopViewColor); |
313 | 339 |
314 NOTREACHED(); | 340 NOTREACHED(); |
315 return 0; | 341 return 0; |
316 } | 342 } |
317 | 343 |
318 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { | 344 void WmWindowAura::SetColorProperty(WmWindowProperty key, SkColor value) { |
319 if (key == WmWindowProperty::TOP_VIEW_COLOR) { | 345 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) { | 907 if (key == aura::client::kAlwaysOnTopKey) { |
882 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 908 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
883 } else if (key == aura::client::kAppIconKey) { | 909 } else if (key == aura::client::kAppIconKey) { |
884 wm_property = WmWindowProperty::APP_ICON; | 910 wm_property = WmWindowProperty::APP_ICON; |
885 } else if (key == aura::client::kDrawAttentionKey) { | 911 } else if (key == aura::client::kDrawAttentionKey) { |
886 wm_property = WmWindowProperty::DRAW_ATTENTION; | 912 wm_property = WmWindowProperty::DRAW_ATTENTION; |
887 } else if (key == aura::client::kExcludeFromMruKey) { | 913 } else if (key == aura::client::kExcludeFromMruKey) { |
888 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; | 914 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; |
889 } else if (key == aura::client::kModalKey) { | 915 } else if (key == aura::client::kModalKey) { |
890 wm_property = WmWindowProperty::MODAL_TYPE; | 916 wm_property = WmWindowProperty::MODAL_TYPE; |
917 } else if (key == kPanelAttachedKey) { | |
918 wm_property = WmWindowProperty::PANEL_ATTACHED; | |
891 } else if (key == kShelfIDKey) { | 919 } else if (key == kShelfIDKey) { |
892 wm_property = WmWindowProperty::SHELF_ID; | 920 wm_property = WmWindowProperty::SHELF_ID; |
893 } else if (key == kShelfItemTypeKey) { | 921 } else if (key == kShelfItemTypeKey) { |
894 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; | 922 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; |
895 } else if (key == kSnapChildrenToPixelBoundary) { | 923 } else if (key == kSnapChildrenToPixelBoundary) { |
896 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; | 924 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; |
897 } else if (key == aura::client::kTopViewInset) { | 925 } else if (key == aura::client::kTopViewInset) { |
898 wm_property = WmWindowProperty::TOP_VIEW_INSET; | 926 wm_property = WmWindowProperty::TOP_VIEW_INSET; |
899 } else if (key == aura::client::kWindowIconKey) { | 927 } else if (key == aura::client::kWindowIconKey) { |
900 wm_property = WmWindowProperty::WINDOW_ICON; | 928 wm_property = WmWindowProperty::WINDOW_ICON; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
946 observer.OnTransientChildAdded(this, Get(transient)); | 974 observer.OnTransientChildAdded(this, Get(transient)); |
947 } | 975 } |
948 | 976 |
949 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 977 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
950 aura::Window* transient) { | 978 aura::Window* transient) { |
951 for (auto& observer : transient_observers_) | 979 for (auto& observer : transient_observers_) |
952 observer.OnTransientChildRemoved(this, Get(transient)); | 980 observer.OnTransientChildRemoved(this, Get(transient)); |
953 } | 981 } |
954 | 982 |
955 } // namespace ash | 983 } // namespace ash |
OLD | NEW |