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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window) { | 142 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window) { |
143 if (window->HasSharedProperty( | 143 if (window->HasSharedProperty( |
144 mus::mojom::WindowManager::kWindowAppIcon_Property)) { | 144 mus::mojom::WindowManager::kWindowAppIcon_Property)) { |
145 return mojo::Array<uint8_t>::From( | 145 return mojo::Array<uint8_t>::From( |
146 window->GetSharedProperty<std::vector<uint8_t>>( | 146 window->GetSharedProperty<std::vector<uint8_t>>( |
147 mus::mojom::WindowManager::kWindowAppIcon_Property)); | 147 mus::mojom::WindowManager::kWindowAppIcon_Property)); |
148 } | 148 } |
149 return mojo::Array<uint8_t>(); | 149 return mojo::Array<uint8_t>(); |
150 } | 150 } |
151 | 151 |
| 152 void SetAppID(mus::Window* window, const base::string16& app_id) { |
| 153 window->SetSharedProperty<base::string16>( |
| 154 mus::mojom::WindowManager::kAppID_Property, app_id); |
| 155 } |
| 156 |
| 157 base::string16 GetAppID(const mus::Window* window) { |
| 158 if (!window->HasSharedProperty(mus::mojom::WindowManager::kAppID_Property)) |
| 159 return base::string16(); |
| 160 |
| 161 return window->GetSharedProperty<base::string16>( |
| 162 mus::mojom::WindowManager::kAppID_Property); |
| 163 } |
| 164 |
152 } // namespace wm | 165 } // namespace wm |
153 } // namespace mash | 166 } // namespace mash |
OLD | NEW |