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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 return; | 326 return; |
327 } | 327 } |
328 | 328 |
329 NOTREACHED(); | 329 NOTREACHED(); |
330 } | 330 } |
331 | 331 |
332 int WmWindowAura::GetIntProperty(WmWindowProperty key) { | 332 int WmWindowAura::GetIntProperty(WmWindowProperty key) { |
333 if (key == WmWindowProperty::MODAL_TYPE) | 333 if (key == WmWindowProperty::MODAL_TYPE) |
334 return window_->GetProperty(aura::client::kModalKey); | 334 return window_->GetProperty(aura::client::kModalKey); |
335 | 335 |
336 if (key == WmWindowProperty::SHELF_ICON_RESOURCE_ID) | |
337 return window_->GetProperty(kShelfIconResourceIdKey); | |
338 | |
339 if (key == WmWindowProperty::SHELF_ID) | 336 if (key == WmWindowProperty::SHELF_ID) |
340 return window_->GetProperty(kShelfIDKey); | 337 return window_->GetProperty(kShelfIDKey); |
341 | 338 |
342 if (key == WmWindowProperty::SHELF_ITEM_TYPE) | 339 if (key == WmWindowProperty::SHELF_ITEM_TYPE) |
343 return window_->GetProperty(kShelfItemTypeKey); | 340 return window_->GetProperty(kShelfItemTypeKey); |
344 | 341 |
345 if (key == WmWindowProperty::TOP_VIEW_INSET) | 342 if (key == WmWindowProperty::TOP_VIEW_INSET) |
346 return window_->GetProperty(aura::client::kTopViewInset); | 343 return window_->GetProperty(aura::client::kTopViewInset); |
347 | 344 |
348 NOTREACHED(); | 345 NOTREACHED(); |
349 return 0; | 346 return 0; |
350 } | 347 } |
351 | 348 |
352 void WmWindowAura::SetIntProperty(WmWindowProperty key, int value) { | 349 void WmWindowAura::SetIntProperty(WmWindowProperty key, int value) { |
353 if (key == WmWindowProperty::SHELF_ICON_RESOURCE_ID) { | |
354 window_->SetProperty(kShelfIconResourceIdKey, value); | |
355 return; | |
356 } | |
357 if (key == WmWindowProperty::SHELF_ID) { | 350 if (key == WmWindowProperty::SHELF_ID) { |
358 window_->SetProperty(kShelfIDKey, value); | 351 window_->SetProperty(kShelfIDKey, value); |
359 return; | 352 return; |
360 } | 353 } |
361 if (key == WmWindowProperty::SHELF_ITEM_TYPE) { | 354 if (key == WmWindowProperty::SHELF_ITEM_TYPE) { |
362 window_->SetProperty(kShelfItemTypeKey, value); | 355 window_->SetProperty(kShelfItemTypeKey, value); |
363 return; | 356 return; |
364 } | 357 } |
365 if (key == WmWindowProperty::TOP_VIEW_INSET) { | 358 if (key == WmWindowProperty::TOP_VIEW_INSET) { |
366 window_->SetProperty(aura::client::kTopViewInset, value); | 359 window_->SetProperty(aura::client::kTopViewInset, value); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 if (key == aura::client::kAlwaysOnTopKey) { | 870 if (key == aura::client::kAlwaysOnTopKey) { |
878 wm_property = WmWindowProperty::ALWAYS_ON_TOP; | 871 wm_property = WmWindowProperty::ALWAYS_ON_TOP; |
879 } else if (key == aura::client::kAppIconKey) { | 872 } else if (key == aura::client::kAppIconKey) { |
880 wm_property = WmWindowProperty::APP_ICON; | 873 wm_property = WmWindowProperty::APP_ICON; |
881 } else if (key == aura::client::kDrawAttentionKey) { | 874 } else if (key == aura::client::kDrawAttentionKey) { |
882 wm_property = WmWindowProperty::DRAW_ATTENTION; | 875 wm_property = WmWindowProperty::DRAW_ATTENTION; |
883 } else if (key == aura::client::kExcludeFromMruKey) { | 876 } else if (key == aura::client::kExcludeFromMruKey) { |
884 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; | 877 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; |
885 } else if (key == aura::client::kModalKey) { | 878 } else if (key == aura::client::kModalKey) { |
886 wm_property = WmWindowProperty::MODAL_TYPE; | 879 wm_property = WmWindowProperty::MODAL_TYPE; |
887 } else if (key == kShelfIconResourceIdKey) { | |
888 wm_property = WmWindowProperty::SHELF_ICON_RESOURCE_ID; | |
889 } else if (key == kShelfIDKey) { | 880 } else if (key == kShelfIDKey) { |
890 wm_property = WmWindowProperty::SHELF_ID; | 881 wm_property = WmWindowProperty::SHELF_ID; |
891 } else if (key == kShelfItemTypeKey) { | 882 } else if (key == kShelfItemTypeKey) { |
892 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; | 883 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; |
893 } else if (key == kSnapChildrenToPixelBoundary) { | 884 } else if (key == kSnapChildrenToPixelBoundary) { |
894 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; | 885 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; |
895 } else if (key == aura::client::kTopViewInset) { | 886 } else if (key == aura::client::kTopViewInset) { |
896 wm_property = WmWindowProperty::TOP_VIEW_INSET; | 887 wm_property = WmWindowProperty::TOP_VIEW_INSET; |
897 } else if (key == aura::client::kWindowIconKey) { | 888 } else if (key == aura::client::kWindowIconKey) { |
898 wm_property = WmWindowProperty::WINDOW_ICON; | 889 wm_property = WmWindowProperty::WINDOW_ICON; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 observer.OnTransientChildAdded(this, Get(transient)); | 935 observer.OnTransientChildAdded(this, Get(transient)); |
945 } | 936 } |
946 | 937 |
947 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 938 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
948 aura::Window* transient) { | 939 aura::Window* transient) { |
949 for (auto& observer : transient_observers_) | 940 for (auto& observer : transient_observers_) |
950 observer.OnTransientChildRemoved(this, Get(transient)); | 941 observer.OnTransientChildRemoved(this, Get(transient)); |
951 } | 942 } |
952 | 943 |
953 } // namespace ash | 944 } // namespace ash |
OLD | NEW |