| 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/window_manager.h" | 5 #include "mash/wm/window_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 |
| 8 #include <utility> | 9 #include <utility> |
| 9 | 10 |
| 10 #include "components/mus/common/types.h" | 11 #include "components/mus/common/types.h" |
| 11 #include "components/mus/public/cpp/window.h" | 12 #include "components/mus/public/cpp/window.h" |
| 12 #include "components/mus/public/cpp/window_property.h" | 13 #include "components/mus/public/cpp/window_property.h" |
| 13 #include "components/mus/public/cpp/window_tree_connection.h" | 14 #include "components/mus/public/cpp/window_tree_connection.h" |
| 14 #include "components/mus/public/interfaces/input_events.mojom.h" | 15 #include "components/mus/public/interfaces/input_events.mojom.h" |
| 15 #include "components/mus/public/interfaces/mus_constants.mojom.h" | 16 #include "components/mus/public/interfaces/mus_constants.mojom.h" |
| 16 #include "components/mus/public/interfaces/window_manager.mojom.h" | 17 #include "components/mus/public/interfaces/window_manager.mojom.h" |
| 17 #include "mash/wm/non_client_frame_controller.h" | 18 #include "mash/wm/non_client_frame_controller.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 140 } |
| 140 | 141 |
| 141 bool WindowManager::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { | 142 bool WindowManager::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { |
| 142 // By returning true the bounds of |window| is updated. | 143 // By returning true the bounds of |window| is updated. |
| 143 return true; | 144 return true; |
| 144 } | 145 } |
| 145 | 146 |
| 146 bool WindowManager::OnWmSetProperty( | 147 bool WindowManager::OnWmSetProperty( |
| 147 mus::Window* window, | 148 mus::Window* window, |
| 148 const std::string& name, | 149 const std::string& name, |
| 149 scoped_ptr<std::vector<uint8_t>>* new_data) { | 150 std::unique_ptr<std::vector<uint8_t>>* new_data) { |
| 150 // TODO(sky): constrain this to set of keys we know about, and allowed | 151 // TODO(sky): constrain this to set of keys we know about, and allowed |
| 151 // values. | 152 // values. |
| 152 return name == mus::mojom::WindowManager::kShowState_Property || | 153 return name == mus::mojom::WindowManager::kShowState_Property || |
| 153 name == mus::mojom::WindowManager::kPreferredSize_Property || | 154 name == mus::mojom::WindowManager::kPreferredSize_Property || |
| 154 name == mus::mojom::WindowManager::kResizeBehavior_Property || | 155 name == mus::mojom::WindowManager::kResizeBehavior_Property || |
| 155 name == mus::mojom::WindowManager::kWindowAppIcon_Property || | 156 name == mus::mojom::WindowManager::kWindowAppIcon_Property || |
| 156 name == mus::mojom::WindowManager::kWindowTitle_Property; | 157 name == mus::mojom::WindowManager::kWindowTitle_Property; |
| 157 } | 158 } |
| 158 | 159 |
| 159 mus::Window* WindowManager::OnWmCreateTopLevelWindow( | 160 mus::Window* WindowManager::OnWmCreateTopLevelWindow( |
| 160 std::map<std::string, std::vector<uint8_t>>* properties) { | 161 std::map<std::string, std::vector<uint8_t>>* properties) { |
| 161 return NewTopLevelWindow(properties); | 162 return NewTopLevelWindow(properties); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void WindowManager::OnAccelerator(uint32_t id, const ui::Event& event) { | 165 void WindowManager::OnAccelerator(uint32_t id, const ui::Event& event) { |
| 165 root_controller_->OnAccelerator(id, std::move(event)); | 166 root_controller_->OnAccelerator(id, std::move(event)); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void WindowManager::ScreenlockStateChanged(bool locked) { | 169 void WindowManager::ScreenlockStateChanged(bool locked) { |
| 169 // Hide USER_PRIVATE windows when the screen is locked. | 170 // Hide USER_PRIVATE windows when the screen is locked. |
| 170 mus::Window* window = root_controller_->GetWindowForContainer( | 171 mus::Window* window = root_controller_->GetWindowForContainer( |
| 171 mash::wm::mojom::Container::USER_PRIVATE); | 172 mash::wm::mojom::Container::USER_PRIVATE); |
| 172 window->SetVisible(!locked); | 173 window->SetVisible(!locked); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace wm | 176 } // namespace wm |
| 176 } // namespace mash | 177 } // namespace mash |
| OLD | NEW |