| 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/window_manager.h" | 5 #include "ash/mus/window_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 364 } |
| 365 | 365 |
| 366 aura::PropertyConverter* WindowManager::GetPropertyConverter() { | 366 aura::PropertyConverter* WindowManager::GetPropertyConverter() { |
| 367 return property_converter_.get(); | 367 return property_converter_.get(); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { | 370 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { |
| 371 window_manager_client_ = client; | 371 window_manager_client_ = client; |
| 372 } | 372 } |
| 373 | 373 |
| 374 bool WindowManager::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) { | 374 void WindowManager::OnWmSetBounds(aura::Window* window, |
| 375 // TODO(sky): this indirectly sets bounds, which is against what | 375 const gfx::Rect& bounds) { |
| 376 // OnWmSetBounds() recommends doing. Remove that restriction, or fix this. | 376 WmWindowMus::Get(window)->SetBounds(bounds); |
| 377 WmWindowMus::Get(window)->SetBounds(*bounds); | |
| 378 *bounds = window->bounds(); | |
| 379 return true; | |
| 380 } | 377 } |
| 381 | 378 |
| 382 bool WindowManager::OnWmSetProperty( | 379 bool WindowManager::OnWmSetProperty( |
| 383 aura::Window* window, | 380 aura::Window* window, |
| 384 const std::string& name, | 381 const std::string& name, |
| 385 std::unique_ptr<std::vector<uint8_t>>* new_data) { | 382 std::unique_ptr<std::vector<uint8_t>>* new_data) { |
| 386 // TODO(sky): constrain this to set of keys we know about, and allowed values. | 383 // TODO(sky): constrain this to set of keys we know about, and allowed values. |
| 387 if (name == ui::mojom::WindowManager::kWindowIgnoredByShelf_Property) { | 384 if (name == ui::mojom::WindowManager::kWindowIgnoredByShelf_Property) { |
| 388 wm::WindowState* window_state = | 385 wm::WindowState* window_state = |
| 389 static_cast<WmWindow*>(WmWindowMus::Get(window))->GetWindowState(); | 386 static_cast<WmWindow*>(WmWindowMus::Get(window))->GetWindowState(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 508 |
| 512 void WindowManager::OnWindowInitialized(aura::Window* window) { | 509 void WindowManager::OnWindowInitialized(aura::Window* window) { |
| 513 // This ensures WmWindowAura won't be called before WmWindowMus. This is | 510 // This ensures WmWindowAura won't be called before WmWindowMus. This is |
| 514 // important as if WmWindowAura::Get() is called first, then WmWindowAura | 511 // important as if WmWindowAura::Get() is called first, then WmWindowAura |
| 515 // would be created, not WmWindowMus. | 512 // would be created, not WmWindowMus. |
| 516 WmWindowMus::Get(window); | 513 WmWindowMus::Get(window); |
| 517 } | 514 } |
| 518 | 515 |
| 519 } // namespace mus | 516 } // namespace mus |
| 520 } // namespace ash | 517 } // namespace ash |
| OLD | NEW |