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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_MUS_USER_ACTIVITY_FORWARDER_H_
6 #define ASH_MUS_USER_ACTIVITY_FORWARDER_H_
7
8 #include "base/macros.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "services/ui/public/interfaces/user_activity_monitor.mojom.h"
11
12 namespace service_manager {
13 class Connector;
14 }
15
16 namespace ui {
17 class UserActivityDetector;
18 }
19
20 namespace ash {
21 namespace mus {
22
23 // Helper class that receives reports of user activity from UserActivityMonitor
24 // and forwards them to ui::UserActivityDetector.
25 // TODO(derat): Make current ui::UserActivityObserver implementations (i.e.
26 // downstream of ui::UserActivityDetector) instead observe UserActivityMonitor
27 // directly: http://crbug.com/626899
28 class UserActivityForwarder : public ui::mojom::UserActivityObserver {
Daniel Erat 2017/01/18 01:12:59 a forwarder like this seems necessary since //serv
29 public:
30 UserActivityForwarder(service_manager::Connector* connector,
31 ui::UserActivityDetector* detector);
32 ~UserActivityForwarder() override;
33
34 private:
35 // ui::mojom::UserActivityObserver:
36 void OnUserActivity();
37
38 ui::mojom::UserActivityMonitorPtr user_activity_monitor_;
39 mojo::Binding<ui::mojom::UserActivityObserver>
40 user_activity_observer_binding_;
41
42 ui::UserActivityDetector* user_activity_detector_; // Not owned.
43
44 DISALLOW_COPY_AND_ASSIGN(UserActivityForwarder);
45 };
46
47 } // namespace mus
48 } // namespace ash
49
50 #endif // ASH_MUS_USER_ACTIVITY_FORWARDER_H_
OLDNEW
« 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