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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/public/renderer/render_view_observer.h" | 9 #include "content/public/renderer/render_view_observer.h" |
10 | 10 |
11 namespace WebKit { | 11 namespace WebKit { |
12 class WebInputEvent; | 12 class WebInputEvent; |
13 } | 13 } |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // Class which observes user input events and postpones | 17 // Class which observes user input events and postpones |
18 // idle notifications if the user is active. | 18 // idle notifications if the user is active. |
19 class IdleUserDetector : public RenderViewObserver { | 19 class IdleUserDetector : public RenderViewObserver { |
20 public: | 20 public: |
21 IdleUserDetector(RenderView* render_view); | 21 explicit IdleUserDetector(RenderView* render_view); |
22 virtual ~IdleUserDetector(); | 22 virtual ~IdleUserDetector(); |
23 | 23 |
24 private: | 24 private: |
25 // RenderViewObserver implementation: | 25 // RenderViewObserver implementation: |
26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
27 | 27 |
28 void OnHandleInputEvent(const WebKit::WebInputEvent* event, | 28 void OnHandleInputEvent(const WebKit::WebInputEvent* event, |
29 bool is_keyboard_shortcut); | 29 bool is_keyboard_shortcut); |
30 | 30 |
31 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); | 31 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); |
32 }; | 32 }; |
33 | 33 |
34 } // namespace content | 34 } // namespace content |
35 | 35 |
36 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 36 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
OLD | NEW |