| 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/user_window_controller_impl.h" | 5 #include "mash/wm/user_window_controller_impl.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 "components/mus/public/cpp/window_tree_connection.h" | 10 #include "components/mus/public/cpp/window_tree_connection.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 mus::mojom::WindowManager::kWindowTitle_Property)); | 25 mus::mojom::WindowManager::kWindowTitle_Property)); |
| 26 } | 26 } |
| 27 return mojo::String(std::string()); | 27 return mojo::String(std::string()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 // Get the serialized app icon bitmap from a mus::Window. | 30 // Get the serialized app icon bitmap from a mus::Window. |
| 31 mojo::Array<uint8_t> GetWindowAppIcon(mus::Window* window) { | 31 mojo::Array<uint8_t> GetWindowAppIcon(mus::Window* window) { |
| 32 if (window->HasSharedProperty( | 32 if (window->HasSharedProperty( |
| 33 mus::mojom::WindowManager::kWindowAppIcon_Property)) { | 33 mus::mojom::WindowManager::kWindowAppIcon_Property)) { |
| 34 return mojo::Array<uint8_t>::From( | 34 return mojo::Array<uint8_t>::From( |
| 35 window->GetSharedProperty<const std::vector<uint8_t>>( | 35 window->GetSharedProperty<std::vector<uint8_t>>( |
| 36 mus::mojom::WindowManager::kWindowAppIcon_Property)); | 36 mus::mojom::WindowManager::kWindowAppIcon_Property)); |
| 37 } | 37 } |
| 38 return mojo::Array<uint8_t>(); | 38 return mojo::Array<uint8_t>(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Returns |window|, or an ancestor thereof, parented to |container|, or null. | 41 // Returns |window|, or an ancestor thereof, parented to |container|, or null. |
| 42 mus::Window* GetTopLevelWindow(mus::Window* window, mus::Window* container) { | 42 mus::Window* GetTopLevelWindow(mus::Window* window, mus::Window* container) { |
| 43 while (window && window->parent() != container) | 43 while (window && window->parent() != container) |
| 44 window = window->parent(); | 44 window = window->parent(); |
| 45 return window; | 45 return window; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { | 173 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { |
| 174 mus::Window* window = GetUserWindowContainer()->GetChildById(window_id); | 174 mus::Window* window = GetUserWindowContainer()->GetChildById(window_id); |
| 175 if (window) | 175 if (window) |
| 176 window->SetFocus(); | 176 window->SetFocus(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace wm | 179 } // namespace wm |
| 180 } // namespace mash | 180 } // namespace mash |
| OLD | NEW |