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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" | 10 #include "ash/common/accelerators/ash_focus_manager_factory.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ash/common/wm/root_window_finder.h" | 42 #include "ash/common/wm/root_window_finder.h" |
43 #include "ash/common/wm/system_modal_container_layout_manager.h" | 43 #include "ash/common/wm/system_modal_container_layout_manager.h" |
44 #include "ash/common/wm/window_cycle_controller.h" | 44 #include "ash/common/wm/window_cycle_controller.h" |
45 #include "ash/common/wm_root_window_controller.h" | 45 #include "ash/common/wm_root_window_controller.h" |
46 #include "ash/common/wm_window.h" | 46 #include "ash/common/wm_window.h" |
47 #include "ash/public/cpp/shell_window_ids.h" | 47 #include "ash/public/cpp/shell_window_ids.h" |
48 #include "base/bind.h" | 48 #include "base/bind.h" |
49 #include "base/logging.h" | 49 #include "base/logging.h" |
50 #include "base/memory/ptr_util.h" | 50 #include "base/memory/ptr_util.h" |
51 #include "ui/app_list/presenter/app_list.h" | 51 #include "ui/app_list/presenter/app_list.h" |
52 #include "ui/app_list/presenter/app_list_presenter.h" | |
53 #include "ui/display/display.h" | 52 #include "ui/display/display.h" |
54 #include "ui/views/focus/focus_manager_factory.h" | 53 #include "ui/views/focus/focus_manager_factory.h" |
55 | 54 |
56 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
57 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" | 56 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" |
58 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" | 57 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" |
59 #include "ash/common/system/chromeos/network/vpn_list.h" | 58 #include "ash/common/system/chromeos/network/vpn_list.h" |
60 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 59 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
61 #endif | 60 #endif |
62 | 61 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 322 } |
324 for (WmWindow* root_window : root_windows) { | 323 for (WmWindow* root_window : root_windows) { |
325 root_window->GetRootWindowController() | 324 root_window->GetRootWindowController() |
326 ->GetSystemModalLayoutManager(removed) | 325 ->GetSystemModalLayoutManager(removed) |
327 ->DestroyModalBackground(); | 326 ->DestroyModalBackground(); |
328 } | 327 } |
329 } | 328 } |
330 | 329 |
331 void WmShell::ShowAppList() { | 330 void WmShell::ShowAppList() { |
332 // Show the app list on the default display for new windows. | 331 // Show the app list on the default display for new windows. |
333 int64_t display_id = | 332 app_list_->Show(GetRootWindowForNewWindows()->GetDisplayNearestWindow().id()); |
334 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id(); | |
335 delegate_->GetAppListPresenter()->Show(display_id); | |
336 } | 333 } |
337 | 334 |
338 void WmShell::DismissAppList() { | 335 void WmShell::DismissAppList() { |
339 delegate_->GetAppListPresenter()->Dismiss(); | 336 app_list_->Dismiss(); |
340 } | 337 } |
341 | 338 |
342 void WmShell::ToggleAppList() { | 339 void WmShell::ToggleAppList() { |
343 // Show the app list on the default display for new windows. | 340 // Toggle the app list on the default display for new windows. |
344 int64_t display_id = | 341 app_list_->ToggleAppList( |
345 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id(); | 342 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id()); |
346 delegate_->GetAppListPresenter()->ToggleAppList(display_id); | |
347 } | 343 } |
348 | 344 |
349 bool WmShell::IsApplistVisible() const { | 345 bool WmShell::IsApplistVisible() const { |
350 return delegate_->GetAppListPresenter()->IsVisible(); | 346 return app_list_->IsVisible(); |
351 } | 347 } |
352 | 348 |
353 bool WmShell::GetAppListTargetVisibility() const { | 349 bool WmShell::GetAppListTargetVisibility() const { |
354 return delegate_->GetAppListPresenter()->GetTargetVisibility(); | 350 return app_list_->GetTargetVisibility(); |
355 } | 351 } |
356 | 352 |
357 void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) { | 353 void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) { |
358 keyboard_ui_ = std::move(keyboard_ui); | 354 keyboard_ui_ = std::move(keyboard_ui); |
359 } | 355 } |
360 | 356 |
361 void WmShell::SetSystemTrayDelegate( | 357 void WmShell::SetSystemTrayDelegate( |
362 std::unique_ptr<SystemTrayDelegate> delegate) { | 358 std::unique_ptr<SystemTrayDelegate> delegate) { |
363 DCHECK(delegate); | 359 DCHECK(delegate); |
364 system_tray_delegate_ = std::move(delegate); | 360 system_tray_delegate_ = std::move(delegate); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 410 } |
415 | 411 |
416 void WmShell::SessionStateChanged(session_manager::SessionState state) { | 412 void WmShell::SessionStateChanged(session_manager::SessionState state) { |
417 // Create the shelf when a session becomes active. It's safe to do this | 413 // Create the shelf when a session becomes active. It's safe to do this |
418 // multiple times (e.g. initial login vs. multiprofile add session). | 414 // multiple times (e.g. initial login vs. multiprofile add session). |
419 if (state == session_manager::SessionState::ACTIVE) | 415 if (state == session_manager::SessionState::ACTIVE) |
420 CreateShelf(); | 416 CreateShelf(); |
421 } | 417 } |
422 | 418 |
423 } // namespace ash | 419 } // namespace ash |
OLD | NEW |