OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 5 #ifndef CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
6 #define CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 6 #define CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/common/input/input_event_dispatch_type.h" |
9 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 class WebInputEvent; | 13 class WebInputEvent; |
13 } | 14 } |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 class LatencyInfo; | 17 class LatencyInfo; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 // Class which observes user input events and postpones | 22 // Class which observes user input events and postpones |
22 // idle notifications if the user is active. | 23 // idle notifications if the user is active. |
23 class IdleUserDetector : public RenderViewObserver { | 24 class IdleUserDetector : public RenderViewObserver { |
24 public: | 25 public: |
25 IdleUserDetector(RenderView* render_view); | 26 IdleUserDetector(RenderView* render_view); |
26 ~IdleUserDetector() override; | 27 ~IdleUserDetector() override; |
27 | 28 |
28 private: | 29 private: |
29 // RenderViewObserver implementation: | 30 // RenderViewObserver implementation: |
30 bool OnMessageReceived(const IPC::Message& message) override; | 31 bool OnMessageReceived(const IPC::Message& message) override; |
31 | 32 |
32 void OnHandleInputEvent(const blink::WebInputEvent* event, | 33 void OnHandleInputEvent(const blink::WebInputEvent* event, |
33 const ui::LatencyInfo& latency_info); | 34 const ui::LatencyInfo& latency_info, |
| 35 InputEventDispatchType dispatch_type); |
34 | 36 |
35 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); | 37 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); |
36 }; | 38 }; |
37 | 39 |
38 } // namespace content | 40 } // namespace content |
39 | 41 |
40 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 42 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
OLD | NEW |