OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/property_util.h" | 5 #include "mash/wm/property_util.h" |
6 | 6 |
7 #include "components/mus/public/cpp/property_type_converters.h" | 7 #include "components/mus/public/cpp/property_type_converters.h" |
8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
9 #include "components/mus/public/cpp/window_property.h" | 9 #include "components/mus/public/cpp/window_property.h" |
| 10 #include "mash/wm/shadow.h" |
10 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
12 | 13 |
13 namespace mash { | 14 namespace mash { |
14 namespace wm { | 15 namespace wm { |
| 16 namespace { |
| 17 |
| 18 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Shadow*, kLocalShadowProperty, nullptr); |
| 19 |
| 20 } // namespace |
15 | 21 |
16 mus::mojom::ShowState GetWindowShowState(const mus::Window* window) { | 22 mus::mojom::ShowState GetWindowShowState(const mus::Window* window) { |
17 if (window->HasSharedProperty( | 23 if (window->HasSharedProperty( |
18 mus::mojom::WindowManager::kShowState_Property)) { | 24 mus::mojom::WindowManager::kShowState_Property)) { |
19 return static_cast<mus::mojom::ShowState>( | 25 return static_cast<mus::mojom::ShowState>( |
20 window->GetSharedProperty<int32_t>( | 26 window->GetSharedProperty<int32_t>( |
21 mus::mojom::WindowManager::kShowState_Property)); | 27 mus::mojom::WindowManager::kShowState_Property)); |
22 } | 28 } |
23 return mus::mojom::SHOW_STATE_RESTORED; | 29 return mus::mojom::SHOW_STATE_RESTORED; |
24 } | 30 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 87 |
82 gfx::Rect GetRestoreBounds(const mus::Window* window) { | 88 gfx::Rect GetRestoreBounds(const mus::Window* window) { |
83 if (window->HasSharedProperty( | 89 if (window->HasSharedProperty( |
84 mus::mojom::WindowManager::kRestoreBounds_Property)) { | 90 mus::mojom::WindowManager::kRestoreBounds_Property)) { |
85 return window->GetSharedProperty<gfx::Rect>( | 91 return window->GetSharedProperty<gfx::Rect>( |
86 mus::mojom::WindowManager::kRestoreBounds_Property); | 92 mus::mojom::WindowManager::kRestoreBounds_Property); |
87 } | 93 } |
88 return gfx::Rect(); | 94 return gfx::Rect(); |
89 } | 95 } |
90 | 96 |
| 97 void SetShadow(mus::Window* window, Shadow* shadow) { |
| 98 window->SetLocalProperty(kLocalShadowProperty, shadow); |
| 99 } |
| 100 |
| 101 Shadow* GetShadow(mus::Window* window) { |
| 102 return window->GetLocalProperty(kLocalShadowProperty); |
| 103 } |
| 104 |
91 } // namespace wm | 105 } // namespace wm |
92 } // namespace mash | 106 } // namespace mash |
OLD | NEW |