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

Unified Diff: ash/shell.cc

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: address jamescook@'s comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index fa1e9a5e8d4a39f03261d44c7153f38db9278a8a..88253d31ba346367776120eecad3cea5afd7d0b4 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -99,9 +99,12 @@
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/system/devicemode.h"
+#include "services/service_manager/public/cpp/connector.h"
+#include "services/ui/public/interfaces/constants.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/mus/user_activity_forwarder.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/ui_base_switches.h"
@@ -734,6 +737,15 @@ void Shell::Init(const ShellInitParams& init_params) {
wm_shell_->AddShellObserver(lock_state_controller_.get());
+ // The connector is unavailable in some tests.
+ if (is_mash && wm_shell_->delegate()->GetShellConnector()) {
+ ui::mojom::UserActivityMonitorPtr user_activity_monitor;
+ wm_shell_->delegate()->GetShellConnector()->BindInterface(
+ ui::mojom::kServiceName, &user_activity_monitor);
+ user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>(
+ std::move(user_activity_monitor), user_activity_detector_.get());
+ }
+
drag_drop_controller_.reset(new DragDropController);
// |screenshot_controller_| needs to be created (and prepended as a
// pre-target handler) at this point, because |mouse_cursor_filter_| needs to
« no previous file with comments | « ash/shell.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698