| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/wm_shell.h" | 5 #include "ash/common/wm_shell.h" |
| 6 | 6 |
| 7 #include "ash/common/focus_cycler.h" | 7 #include "ash/common/focus_cycler.h" |
| 8 #include "ash/common/keyboard/keyboard_ui.h" |
| 8 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 10 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
| 11 #include "ash/common/system/tray/system_tray_notifier.h" | 12 #include "ash/common/system/tray/system_tray_notifier.h" |
| 12 #include "ash/common/wm/overview/window_selector_controller.h" | 13 #include "ash/common/wm/overview/window_selector_controller.h" |
| 13 #include "ash/common/wm_window.h" | 14 #include "ash/common/wm_window.h" |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 | 17 |
| 17 namespace ash { | 18 namespace ash { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 continue; | 50 continue; |
| 50 for (const WmWindow* child : system_modal->GetChildren()) { | 51 for (const WmWindow* child : system_modal->GetChildren()) { |
| 51 if (child->IsSystemModal() && child->GetTargetVisibility()) { | 52 if (child->IsSystemModal() && child->GetTargetVisibility()) { |
| 52 return true; | 53 return true; |
| 53 } | 54 } |
| 54 } | 55 } |
| 55 } | 56 } |
| 56 return false; | 57 return false; |
| 57 } | 58 } |
| 58 | 59 |
| 60 void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) { |
| 61 keyboard_ui_ = std::move(keyboard_ui); |
| 62 } |
| 63 |
| 59 void WmShell::SetSystemTrayDelegate( | 64 void WmShell::SetSystemTrayDelegate( |
| 60 std::unique_ptr<SystemTrayDelegate> delegate) { | 65 std::unique_ptr<SystemTrayDelegate> delegate) { |
| 61 DCHECK(delegate); | 66 DCHECK(delegate); |
| 62 DCHECK(!system_tray_delegate_); | 67 DCHECK(!system_tray_delegate_); |
| 63 // TODO(jamescook): Create via ShellDelegate once it moves to //ash/common. | 68 // TODO(jamescook): Create via ShellDelegate once it moves to //ash/common. |
| 64 system_tray_delegate_ = std::move(delegate); | 69 system_tray_delegate_ = std::move(delegate); |
| 65 system_tray_delegate_->Initialize(); | 70 system_tray_delegate_->Initialize(); |
| 66 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 67 logout_confirmation_controller_.reset(new LogoutConfirmationController( | 72 logout_confirmation_controller_.reset(new LogoutConfirmationController( |
| 68 base::Bind(&SystemTrayDelegate::SignOut, | 73 base::Bind(&SystemTrayDelegate::SignOut, |
| 69 base::Unretained(system_tray_delegate_.get())))); | 74 base::Unretained(system_tray_delegate_.get())))); |
| 70 #endif | 75 #endif |
| 71 } | 76 } |
| 72 | 77 |
| 73 void WmShell::DeleteSystemTrayDelegate() { | 78 void WmShell::DeleteSystemTrayDelegate() { |
| 74 DCHECK(system_tray_delegate_); | 79 DCHECK(system_tray_delegate_); |
| 75 #if defined(OS_CHROMEOS) | 80 #if defined(OS_CHROMEOS) |
| 76 logout_confirmation_controller_.reset(); | 81 logout_confirmation_controller_.reset(); |
| 77 #endif | 82 #endif |
| 78 system_tray_delegate_.reset(); | 83 system_tray_delegate_.reset(); |
| 79 } | 84 } |
| 80 | 85 |
| 81 void WmShell::DeleteWindowSelectorController() { | 86 void WmShell::DeleteWindowSelectorController() { |
| 82 window_selector_controller_.reset(); | 87 window_selector_controller_.reset(); |
| 83 } | 88 } |
| 84 | 89 |
| 85 } // namespace ash | 90 } // namespace ash |
| OLD | NEW |