Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: add comments to UserActivityPowerManagerNotifier Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.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/key_event_watcher.h" 10 #include "ash/common/key_event_watcher.h"
11 #include "ash/common/session/session_state_delegate.h" 11 #include "ash/common/session/session_state_delegate.h"
12 #include "ash/common/shell_delegate.h" 12 #include "ash/common/shell_delegate.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/wallpaper/wallpaper_delegate.h" 15 #include "ash/common/wallpaper/wallpaper_delegate.h"
16 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" 16 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h"
17 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h" 17 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
18 #include "ash/common/wm/mru_window_tracker.h" 18 #include "ash/common/wm/mru_window_tracker.h"
19 #include "ash/common/wm/window_cycle_event_filter.h" 19 #include "ash/common/wm/window_cycle_event_filter.h"
20 #include "ash/common/wm/window_resizer.h" 20 #include "ash/common/wm/window_resizer.h"
21 #include "ash/common/wm_activation_observer.h" 21 #include "ash/common/wm_activation_observer.h"
22 #include "ash/common/wm_window.h" 22 #include "ash/common/wm_window.h"
23 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h" 23 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h"
24 #include "ash/mus/accelerators/accelerator_controller_registrar.h" 24 #include "ash/mus/accelerators/accelerator_controller_registrar.h"
25 #include "ash/mus/bridge/immersive_handler_factory_mus.h" 25 #include "ash/mus/bridge/immersive_handler_factory_mus.h"
26 #include "ash/mus/bridge/workspace_event_handler_mus.h" 26 #include "ash/mus/bridge/workspace_event_handler_mus.h"
27 #include "ash/mus/drag_window_resizer.h" 27 #include "ash/mus/drag_window_resizer.h"
28 #include "ash/mus/keyboard_ui_mus.h" 28 #include "ash/mus/keyboard_ui_mus.h"
29 #include "ash/mus/root_window_controller.h" 29 #include "ash/mus/root_window_controller.h"
30 #include "ash/mus/user_activity_forwarder.h"
30 #include "ash/mus/window_manager.h" 31 #include "ash/mus/window_manager.h"
31 #include "ash/shared/immersive_fullscreen_controller.h" 32 #include "ash/shared/immersive_fullscreen_controller.h"
32 #include "base/memory/ptr_util.h" 33 #include "base/memory/ptr_util.h"
33 #include "components/user_manager/user_info_impl.h" 34 #include "components/user_manager/user_info_impl.h"
34 #include "ui/aura/mus/window_tree_client.h" 35 #include "ui/aura/mus/window_tree_client.h"
35 #include "ui/aura/window.h" 36 #include "ui/aura/window.h"
37 #include "ui/base/user_activity/user_activity_detector.h"
38 #include "ui/chromeos/user_activity_power_manager_notifier.h"
36 #include "ui/display/manager/managed_display_info.h" 39 #include "ui/display/manager/managed_display_info.h"
37 #include "ui/display/screen.h" 40 #include "ui/display/screen.h"
38 #include "ui/views/mus/pointer_watcher_event_router.h" 41 #include "ui/views/mus/pointer_watcher_event_router.h"
39 #include "ui/wm/core/capture_controller.h" 42 #include "ui/wm/core/capture_controller.h"
40 #include "ui/wm/core/focus_controller.h" 43 #include "ui/wm/core/focus_controller.h"
41 44
42 namespace ash { 45 namespace ash {
43 namespace mus { 46 namespace mus {
44 47
45 namespace { 48 namespace {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 107
105 } // namespace 108 } // namespace
106 109
107 WmShellMus::WmShellMus( 110 WmShellMus::WmShellMus(
108 std::unique_ptr<ShellDelegate> shell_delegate, 111 std::unique_ptr<ShellDelegate> shell_delegate,
109 WindowManager* window_manager, 112 WindowManager* window_manager,
110 views::PointerWatcherEventRouter* pointer_watcher_event_router) 113 views::PointerWatcherEventRouter* pointer_watcher_event_router)
111 : WmShell(std::move(shell_delegate)), 114 : WmShell(std::move(shell_delegate)),
112 window_manager_(window_manager), 115 window_manager_(window_manager),
113 pointer_watcher_event_router_(pointer_watcher_event_router), 116 pointer_watcher_event_router_(pointer_watcher_event_router),
114 session_state_delegate_(new SessionStateDelegateStub) { 117 session_state_delegate_(new SessionStateDelegateStub),
118 user_activity_detector_(base::MakeUnique<ui::UserActivityDetector>()),
119 user_activity_notifier_(
120 base::MakeUnique<ui::UserActivityPowerManagerNotifier>(
121 user_activity_detector_.get())),
122 user_activity_forwarder_(base::MakeUnique<UserActivityForwarder>(
123 delegate()->GetShellConnector(),
124 user_activity_detector_.get())) {
sadrul 2017/01/18 22:10:58 I guess we will now use the UserActivityDetector t
Daniel Erat 2017/01/19 01:56:24 yep, i just saw sky's message about ash::Shell. :-
115 WmShell::Set(this); 125 WmShell::Set(this);
116 126
117 uint16_t accelerator_namespace_id = 0u; 127 uint16_t accelerator_namespace_id = 0u;
118 const bool add_result = 128 const bool add_result =
119 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id); 129 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
120 // WmShellMus is created early on, so that this should always succeed. 130 // WmShellMus is created early on, so that this should always succeed.
121 DCHECK(add_result); 131 DCHECK(add_result);
122 accelerator_controller_delegate_.reset( 132 accelerator_controller_delegate_.reset(
123 new AcceleratorControllerDelegateMus(window_manager_)); 133 new AcceleratorControllerDelegateMus(window_manager_));
124 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar( 134 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar(
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 WmWindow* gained_active_wm = WmWindow::Get(gained_active); 447 WmWindow* gained_active_wm = WmWindow::Get(gained_active);
438 if (gained_active_wm) 448 if (gained_active_wm)
439 set_root_window_for_new_windows(gained_active_wm->GetRootWindow()); 449 set_root_window_for_new_windows(gained_active_wm->GetRootWindow());
440 WmWindow* lost_active_wm = WmWindow::Get(lost_active); 450 WmWindow* lost_active_wm = WmWindow::Get(lost_active);
441 for (auto& observer : activation_observers_) 451 for (auto& observer : activation_observers_)
442 observer.OnWindowActivated(gained_active_wm, lost_active_wm); 452 observer.OnWindowActivated(gained_active_wm, lost_active_wm);
443 } 453 }
444 454
445 } // namespace mus 455 } // namespace mus
446 } // namespace ash 456 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698