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

Side by Side Diff: ui/aura/mus/user_activity_forwarder.h

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: fix mash_unittests and use NON_EXPORTED_BASE() 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 UI_AURA_MUS_USER_ACTIVITY_FORWARDER_H_
6 #define UI_AURA_MUS_USER_ACTIVITY_FORWARDER_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "services/ui/public/interfaces/user_activity_monitor.mojom.h"
12 #include "ui/aura/aura_export.h"
13
14 namespace ui {
15 class UserActivityDetector;
16 }
17
18 namespace aura {
19
20 // Helper class that receives reports of user activity from UserActivityMonitor
James Cook 2017/01/20 03:38:49 super nit: I find it helpful for classes like this
Daniel Erat 2017/01/20 16:49:45 sure, done! i like these comments too.
21 // and forwards them to ui::UserActivityDetector.
22 // TODO(derat): Make current ui::UserActivityObserver implementations (i.e.
23 // downstream of ui::UserActivityDetector) instead observe UserActivityMonitor
24 // directly: http://crbug.com/626899
25 class AURA_EXPORT UserActivityForwarder
26 : NON_EXPORTED_BASE(public ui::mojom::UserActivityObserver) {
27 public:
28 UserActivityForwarder(ui::mojom::UserActivityMonitorPtr monitor,
29 ui::UserActivityDetector* detector);
30 ~UserActivityForwarder() override;
31
32 private:
33 // ui::mojom::UserActivityObserver:
34 void OnUserActivity() override;
35
36 ui::mojom::UserActivityMonitorPtr monitor_;
37 mojo::Binding<ui::mojom::UserActivityObserver> binding_;
38
39 ui::UserActivityDetector* detector_; // Not owned.
40
41 DISALLOW_COPY_AND_ASSIGN(UserActivityForwarder);
42 };
43
44 } // namespace aura
45
46 #endif // UI_AURA_MUS_USER_ACTIVITY_FORWARDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698