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

Unified Diff: ash/mus/user_activity_forwarder.h

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: 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/mus/bridge/wm_shell_mus.cc ('k') | ash/mus/user_activity_forwarder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/user_activity_forwarder.h
diff --git a/ash/mus/user_activity_forwarder.h b/ash/mus/user_activity_forwarder.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b805250155720a8c081b1e9705bc8c027cd0111
--- /dev/null
+++ b/ash/mus/user_activity_forwarder.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_MUS_USER_ACTIVITY_FORWARDER_H_
+#define ASH_MUS_USER_ACTIVITY_FORWARDER_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/ui/public/interfaces/user_activity_monitor.mojom.h"
+
+namespace service_manager {
+class Connector;
+}
+
+namespace ui {
+class UserActivityDetector;
+}
+
+namespace ash {
+namespace mus {
+
+// Helper class that receives reports of user activity from UserActivityMonitor
+// and forwards them to ui::UserActivityDetector.
+// TODO(derat): Make current ui::UserActivityObserver implementations (i.e.
+// downstream of ui::UserActivityDetector) instead observe UserActivityMonitor
+// directly: http://crbug.com/626899
+class UserActivityForwarder : public ui::mojom::UserActivityObserver {
Daniel Erat 2017/01/18 01:12:59 a forwarder like this seems necessary since //serv
+ public:
+ UserActivityForwarder(service_manager::Connector* connector,
+ ui::UserActivityDetector* detector);
+ ~UserActivityForwarder() override;
+
+ private:
+ // ui::mojom::UserActivityObserver:
+ void OnUserActivity();
+
+ ui::mojom::UserActivityMonitorPtr user_activity_monitor_;
+ mojo::Binding<ui::mojom::UserActivityObserver>
+ user_activity_observer_binding_;
+
+ ui::UserActivityDetector* user_activity_detector_; // Not owned.
+
+ DISALLOW_COPY_AND_ASSIGN(UserActivityForwarder);
+};
+
+} // namespace mus
+} // namespace ash
+
+#endif // ASH_MUS_USER_ACTIVITY_FORWARDER_H_
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/mus/user_activity_forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698