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

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: 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 unified diff | Download patch
« no previous file with comments | « ui/aura/mus/DEPS ('k') | ui/aura/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 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 the mojo
21 // UserActivityMonitor interface (in the window server) and forwards them to
22 // ui::UserActivityDetector (usually in ash).
23 // TODO(derat): Make current ui::UserActivityObserver implementations (i.e.
24 // downstream of ui::UserActivityDetector) instead observe UserActivityMonitor
25 // directly: http://crbug.com/626899
26 class AURA_EXPORT UserActivityForwarder
27 : NON_EXPORTED_BASE(public ui::mojom::UserActivityObserver) {
28 public:
29 UserActivityForwarder(ui::mojom::UserActivityMonitorPtr monitor,
30 ui::UserActivityDetector* detector);
31 ~UserActivityForwarder() override;
32
33 private:
34 // ui::mojom::UserActivityObserver:
35 void OnUserActivity() override;
36
37 ui::mojom::UserActivityMonitorPtr monitor_;
38 mojo::Binding<ui::mojom::UserActivityObserver> binding_;
39
40 ui::UserActivityDetector* detector_; // Not owned.
41
42 DISALLOW_COPY_AND_ASSIGN(UserActivityForwarder);
43 };
44
45 } // namespace aura
46
47 #endif // UI_AURA_MUS_USER_ACTIVITY_FORWARDER_H_
OLDNEW
« no previous file with comments | « ui/aura/mus/DEPS ('k') | ui/aura/mus/user_activity_forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698