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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "components/mus/public/cpp/property_type_converters.h" | 9 #include "components/mus/public/cpp/property_type_converters.h" |
10 #include "components/mus/public/cpp/window_property.h" | 10 #include "components/mus/public/cpp/window_property.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const mus::Window::SharedProperties& properties) { | 122 const mus::Window::SharedProperties& properties) { |
123 const auto iter = | 123 const auto iter = |
124 properties.find(mus::mojom::WindowManager::kWindowType_Property); | 124 properties.find(mus::mojom::WindowManager::kWindowType_Property); |
125 if (iter != properties.end()) { | 125 if (iter != properties.end()) { |
126 return static_cast<mus::mojom::WindowType>( | 126 return static_cast<mus::mojom::WindowType>( |
127 mojo::ConvertTo<int32_t>(iter->second)); | 127 mojo::ConvertTo<int32_t>(iter->second)); |
128 } | 128 } |
129 return mus::mojom::WindowType::POPUP; | 129 return mus::mojom::WindowType::POPUP; |
130 } | 130 } |
131 | 131 |
| 132 mojom::AshWindowType GetAshWindowType(const mus::Window* window) { |
| 133 if (!window->HasSharedProperty(mojom::kAshWindowType_Property)) |
| 134 return mojom::AshWindowType::COUNT; |
| 135 |
| 136 return static_cast<mojom::AshWindowType>( |
| 137 window->GetSharedProperty<int32_t>(mojom::kAshWindowType_Property)); |
| 138 } |
| 139 |
132 base::string16 GetWindowTitle(const mus::Window* window) { | 140 base::string16 GetWindowTitle(const mus::Window* window) { |
133 if (!window->HasSharedProperty( | 141 if (!window->HasSharedProperty( |
134 mus::mojom::WindowManager::kWindowTitle_Property)) { | 142 mus::mojom::WindowManager::kWindowTitle_Property)) { |
135 return base::string16(); | 143 return base::string16(); |
136 } | 144 } |
137 | 145 |
138 return window->GetSharedProperty<base::string16>( | 146 return window->GetSharedProperty<base::string16>( |
139 mus::mojom::WindowManager::kWindowTitle_Property); | 147 mus::mojom::WindowManager::kWindowTitle_Property); |
140 } | 148 } |
141 | 149 |
(...skipping 15 matching lines...) Expand all Loading... |
157 base::string16 GetAppID(const mus::Window* window) { | 165 base::string16 GetAppID(const mus::Window* window) { |
158 if (!window->HasSharedProperty(mus::mojom::WindowManager::kAppID_Property)) | 166 if (!window->HasSharedProperty(mus::mojom::WindowManager::kAppID_Property)) |
159 return base::string16(); | 167 return base::string16(); |
160 | 168 |
161 return window->GetSharedProperty<base::string16>( | 169 return window->GetSharedProperty<base::string16>( |
162 mus::mojom::WindowManager::kAppID_Property); | 170 mus::mojom::WindowManager::kAppID_Property); |
163 } | 171 } |
164 | 172 |
165 } // namespace wm | 173 } // namespace wm |
166 } // namespace mash | 174 } // namespace mash |
OLD | NEW |