OLD | NEW |
(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_ |
OLD | NEW |