| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 void WindowManager::OnWmSetModalType(aura::Window* window, ui::ModalType type) { | 350 void WindowManager::OnWmSetModalType(aura::Window* window, ui::ModalType type) { |
| 351 ui::ModalType old_type = window->GetProperty(aura::client::kModalKey); | 351 ui::ModalType old_type = window->GetProperty(aura::client::kModalKey); |
| 352 if (type == old_type) | 352 if (type == old_type) |
| 353 return; | 353 return; |
| 354 | 354 |
| 355 window->SetProperty(aura::client::kModalKey, type); | 355 window->SetProperty(aura::client::kModalKey, type); |
| 356 if (type != ui::MODAL_TYPE_SYSTEM && old_type != ui::MODAL_TYPE_SYSTEM) | 356 if (type != ui::MODAL_TYPE_SYSTEM && old_type != ui::MODAL_TYPE_SYSTEM) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 WmWindow* new_parent = | 359 aura::Window* new_parent = wm::GetDefaultParent(window, window->bounds()); |
| 360 wm::GetDefaultParent(WmWindow::Get(window), window->bounds()); | |
| 361 DCHECK(new_parent); | 360 DCHECK(new_parent); |
| 362 if (window->parent()) | 361 if (window->parent()) |
| 363 window->parent()->RemoveChild(window); | 362 window->parent()->RemoveChild(window); |
| 364 new_parent->aura_window()->AddChild(window); | 363 new_parent->AddChild(window); |
| 365 } | 364 } |
| 366 | 365 |
| 367 void WindowManager::OnWmSetCanFocus(aura::Window* window, bool can_focus) { | 366 void WindowManager::OnWmSetCanFocus(aura::Window* window, bool can_focus) { |
| 368 NonClientFrameController* non_client_frame_controller = | 367 NonClientFrameController* non_client_frame_controller = |
| 369 NonClientFrameController::Get(window); | 368 NonClientFrameController::Get(window); |
| 370 if (non_client_frame_controller) | 369 if (non_client_frame_controller) |
| 371 non_client_frame_controller->set_can_activate(can_focus); | 370 non_client_frame_controller->set_can_activate(can_focus); |
| 372 } | 371 } |
| 373 | 372 |
| 374 aura::Window* WindowManager::OnWmCreateTopLevelWindow( | 373 aura::Window* WindowManager::OnWmCreateTopLevelWindow( |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 bool WindowManager::IsWindowActive(aura::Window* window) { | 560 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 562 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 561 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
| 563 } | 562 } |
| 564 | 563 |
| 565 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 564 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 566 Shell::Get()->activation_client()->DeactivateWindow(window); | 565 Shell::Get()->activation_client()->DeactivateWindow(window); |
| 567 } | 566 } |
| 568 | 567 |
| 569 } // namespace mus | 568 } // namespace mus |
| 570 } // namespace ash | 569 } // namespace ash |
| OLD | NEW |