| 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 "ash/mus/property_util.h" | 5 #include "ash/mus/property_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "ash/mus/shadow.h" | 9 #include "ash/mus/shadow.h" |
| 10 #include "components/mus/public/cpp/property_type_converters.h" | 10 #include "components/mus/public/cpp/property_type_converters.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 gfx::Size GetWindowPreferredSize(const ::mus::Window* window) { | 68 gfx::Size GetWindowPreferredSize(const ::mus::Window* window) { |
| 69 if (window->HasSharedProperty( | 69 if (window->HasSharedProperty( |
| 70 ::mus::mojom::WindowManager::kPreferredSize_Property)) { | 70 ::mus::mojom::WindowManager::kPreferredSize_Property)) { |
| 71 return window->GetSharedProperty<gfx::Size>( | 71 return window->GetSharedProperty<gfx::Size>( |
| 72 ::mus::mojom::WindowManager::kPreferredSize_Property); | 72 ::mus::mojom::WindowManager::kPreferredSize_Property); |
| 73 } | 73 } |
| 74 return gfx::Size(); | 74 return gfx::Size(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 mojom::Container GetRequestedContainer(const ::mus::Window* window) { | 77 bool GetRequestedContainer(const ::mus::Window* window, |
| 78 if (window->HasSharedProperty(mojom::kWindowContainer_Property)) { | 78 mojom::Container* container) { |
| 79 return static_cast<mojom::Container>( | 79 if (!window->HasSharedProperty(mojom::kWindowContainer_Property)) |
| 80 window->GetSharedProperty<int32_t>(mojom::kWindowContainer_Property)); | 80 return false; |
| 81 } | 81 |
| 82 return mojom::Container::USER_PRIVATE_WINDOWS; | 82 *container = static_cast<mojom::Container>( |
| 83 window->GetSharedProperty<int32_t>(mojom::kWindowContainer_Property)); |
| 84 return true; |
| 83 } | 85 } |
| 84 | 86 |
| 85 int32_t GetResizeBehavior(const ::mus::Window* window) { | 87 int32_t GetResizeBehavior(const ::mus::Window* window) { |
| 86 if (window->HasSharedProperty( | 88 if (window->HasSharedProperty( |
| 87 ::mus::mojom::WindowManager::kResizeBehavior_Property)) { | 89 ::mus::mojom::WindowManager::kResizeBehavior_Property)) { |
| 88 return window->GetSharedProperty<int32_t>( | 90 return window->GetSharedProperty<int32_t>( |
| 89 ::mus::mojom::WindowManager::kResizeBehavior_Property); | 91 ::mus::mojom::WindowManager::kResizeBehavior_Property); |
| 90 } | 92 } |
| 91 return ::mus::mojom::kResizeBehaviorNone; | 93 return ::mus::mojom::kResizeBehaviorNone; |
| 92 } | 94 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 230 |
| 229 bool IsAlwaysOnTop(::mus::Window* window) { | 231 bool IsAlwaysOnTop(::mus::Window* window) { |
| 230 return window->HasSharedProperty( | 232 return window->HasSharedProperty( |
| 231 ::mus::mojom::WindowManager::kAlwaysOnTop_Property) && | 233 ::mus::mojom::WindowManager::kAlwaysOnTop_Property) && |
| 232 window->GetSharedProperty<bool>( | 234 window->GetSharedProperty<bool>( |
| 233 ::mus::mojom::WindowManager::kAlwaysOnTop_Property); | 235 ::mus::mojom::WindowManager::kAlwaysOnTop_Property); |
| 234 } | 236 } |
| 235 | 237 |
| 236 } // namespace mus | 238 } // namespace mus |
| 237 } // namespace ash | 239 } // namespace ash |
| OLD | NEW |