| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 aura::Window* window, | 492 aura::Window* window, |
| 493 const gfx::Insets& insets, | 493 const gfx::Insets& insets, |
| 494 const std::vector<gfx::Rect>& additional_client_areas) { | 494 const std::vector<gfx::Rect>& additional_client_areas) { |
| 495 NonClientFrameController* non_client_frame_controller = | 495 NonClientFrameController* non_client_frame_controller = |
| 496 NonClientFrameController::Get(window); | 496 NonClientFrameController::Get(window); |
| 497 if (!non_client_frame_controller) | 497 if (!non_client_frame_controller) |
| 498 return; | 498 return; |
| 499 non_client_frame_controller->SetClientArea(insets, additional_client_areas); | 499 non_client_frame_controller->SetClientArea(insets, additional_client_areas); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 503 aura::client::ActivationClient* activation_client = |
| 504 static_cast<aura::client::ActivationClient*>(focus_controller_.get()); |
| 505 if (activation_client->GetActiveWindow() != window) { |
| 506 DVLOG(1) << "Non-active window requested deactivation."; |
| 507 return; |
| 508 } |
| 509 |
| 510 activation_client->DeactivateWindow(window); |
| 511 } |
| 512 |
| 502 void WindowManager::OnWindowInitialized(aura::Window* window) { | 513 void WindowManager::OnWindowInitialized(aura::Window* window) { |
| 503 // This ensures WmWindowAura won't be called before WmWindowMus. This is | 514 // This ensures WmWindowAura won't be called before WmWindowMus. This is |
| 504 // important as if WmWindowAura::Get() is called first, then WmWindowAura | 515 // important as if WmWindowAura::Get() is called first, then WmWindowAura |
| 505 // would be created, not WmWindowMus. | 516 // would be created, not WmWindowMus. |
| 506 WmWindowMus::Get(window); | 517 WmWindowMus::Get(window); |
| 507 } | 518 } |
| 508 | 519 |
| 509 } // namespace mus | 520 } // namespace mus |
| 510 } // namespace ash | 521 } // namespace ash |
| OLD | NEW |