| 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 "services/ui/public/cpp/property_type_converters.h" | 10 #include "services/ui/public/cpp/property_type_converters.h" |
| 11 #include "services/ui/public/cpp/window_property.h" | 11 #include "services/ui/public/cpp/window_property.h" |
| 12 #include "services/ui/public/interfaces/window_manager.mojom.h" | 12 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 13 #include "ui/display/types/display_constants.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ash::mus::Shadow*, | 19 MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ash::mus::Shadow*, |
| 19 kLocalShadowProperty, | 20 kLocalShadowProperty, |
| 20 nullptr); | 21 nullptr); |
| 21 MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kWindowIsJankyProperty, false); | 22 MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kWindowIsJankyProperty, false); |
| 22 | 23 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 bool ShouldRenderParentTitleArea(ui::Window* window) { | 256 bool ShouldRenderParentTitleArea(ui::Window* window) { |
| 256 return window->HasSharedProperty( | 257 return window->HasSharedProperty( |
| 257 ui::mojom::WindowManager::kRendererParentTitleArea_Property) && | 258 ui::mojom::WindowManager::kRendererParentTitleArea_Property) && |
| 258 window->GetSharedProperty<bool>( | 259 window->GetSharedProperty<bool>( |
| 259 ui::mojom::WindowManager::kRendererParentTitleArea_Property); | 260 ui::mojom::WindowManager::kRendererParentTitleArea_Property); |
| 260 } | 261 } |
| 261 | 262 |
| 262 int64_t GetInitialDisplayId(const ui::Window::SharedProperties& properties) { | 263 int64_t GetInitialDisplayId(const ui::Window::SharedProperties& properties) { |
| 263 auto iter = | 264 auto iter = |
| 264 properties.find(ui::mojom::WindowManager::kInitialDisplayId_Property); | 265 properties.find(ui::mojom::WindowManager::kInitialDisplayId_Property); |
| 265 return iter == properties.end() ? display::Display::kInvalidDisplayID | 266 return iter == properties.end() ? display::kInvalidDisplayId |
| 266 : mojo::ConvertTo<int64_t>(iter->second); | 267 : mojo::ConvertTo<int64_t>(iter->second); |
| 267 } | 268 } |
| 268 | 269 |
| 269 void SetExcludeFromMru(ui::Window* window, bool value) { | 270 void SetExcludeFromMru(ui::Window* window, bool value) { |
| 270 window->SetSharedProperty<bool>( | 271 window->SetSharedProperty<bool>( |
| 271 ui::mojom::WindowManager::kExcludeFromMru_Property, value); | 272 ui::mojom::WindowManager::kExcludeFromMru_Property, value); |
| 272 } | 273 } |
| 273 | 274 |
| 274 bool GetExcludeFromMru(const ui::Window* window) { | 275 bool GetExcludeFromMru(const ui::Window* window) { |
| 275 return window->HasSharedProperty( | 276 return window->HasSharedProperty( |
| 276 ui::mojom::WindowManager::kExcludeFromMru_Property) && | 277 ui::mojom::WindowManager::kExcludeFromMru_Property) && |
| 277 window->GetSharedProperty<bool>( | 278 window->GetSharedProperty<bool>( |
| 278 ui::mojom::WindowManager::kExcludeFromMru_Property); | 279 ui::mojom::WindowManager::kExcludeFromMru_Property); |
| 279 } | 280 } |
| 280 | 281 |
| 281 } // namespace mus | 282 } // namespace mus |
| 282 } // namespace ash | 283 } // namespace ash |
| OLD | NEW |