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 <vector> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "content/common/input/input_event_dispatch_type.h" | 11 #include "content/common/input/input_event_dispatch_type.h" |
10 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_view_observer.h" |
11 | 13 |
12 namespace blink { | 14 namespace blink { |
13 class WebInputEvent; | 15 class CoalescedWebInputEvent; |
14 } | 16 } |
15 | 17 |
16 namespace ui { | 18 namespace ui { |
17 class LatencyInfo; | 19 class LatencyInfo; |
18 } | 20 } |
19 | 21 |
20 namespace content { | 22 namespace content { |
21 | 23 |
22 // Class which observes user input events and postpones | 24 // Class which observes user input events and postpones |
23 // idle notifications if the user is active. | 25 // idle notifications if the user is active. |
24 class IdleUserDetector : public RenderViewObserver { | 26 class IdleUserDetector : public RenderViewObserver { |
25 public: | 27 public: |
26 IdleUserDetector(RenderView* render_view); | 28 IdleUserDetector(RenderView* render_view); |
27 ~IdleUserDetector() override; | 29 ~IdleUserDetector() override; |
28 | 30 |
29 private: | 31 private: |
30 // RenderViewObserver implementation: | 32 // RenderViewObserver implementation: |
31 bool OnMessageReceived(const IPC::Message& message) override; | 33 bool OnMessageReceived(const IPC::Message& message) override; |
32 void OnDestruct() override; | 34 void OnDestruct() override; |
33 | 35 |
34 void OnHandleInputEvent(const blink::WebInputEvent* event, | 36 void OnHandleInputEvent(const blink::CoalescedWebInputEvent* event, |
35 const ui::LatencyInfo& latency_info, | 37 const ui::LatencyInfo& latency_info, |
36 InputEventDispatchType dispatch_type); | 38 InputEventDispatchType dispatch_type); |
37 | 39 |
38 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); | 40 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); |
39 }; | 41 }; |
40 | 42 |
41 } // namespace content | 43 } // namespace content |
42 | 44 |
43 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 45 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
OLD | NEW |