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

Side by Side Diff: ash/mus/user_activity_forwarder.h

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: avoid dereferencing null connector in mash_unittests 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
(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 {
James Cook 2017/01/18 17:01:38 I wonder if this class could live under //ui. Whil
Daniel Erat 2017/01/18 18:54:20 are you proposing something like the following? -
James Cook 2017/01/18 20:17:32 If you look under //ui you'll see several cases wh
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() override;
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

Powered by Google App Engine
This is Rietveld 408576698