| 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/common/input/input_event_dispatch_type.h" |
| 10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 // Class which observes user input events and postpones | 24 // Class which observes user input events and postpones |
| 25 // idle notifications if the user is active. | 25 // idle notifications if the user is active. |
| 26 class IdleUserDetector : public RenderViewObserver { | 26 class IdleUserDetector : public RenderViewObserver { |
| 27 public: | 27 public: |
| 28 IdleUserDetector(RenderView* render_view); | 28 IdleUserDetector(RenderView* render_view); |
| 29 ~IdleUserDetector() override; | 29 ~IdleUserDetector() override; |
| 30 | 30 |
| 31 void ActivityDetected(); |
| 32 |
| 31 private: | 33 private: |
| 32 // RenderViewObserver implementation: | 34 // RenderViewObserver implementation: |
| 33 bool OnMessageReceived(const IPC::Message& message) override; | 35 bool OnMessageReceived(const IPC::Message& message) override; |
| 34 void OnDestruct() override; | 36 void OnDestruct() override; |
| 35 | 37 |
| 36 void OnHandleInputEvent( | 38 void OnHandleInputEvent( |
| 37 const blink::WebInputEvent* event, | 39 const blink::WebInputEvent* event, |
| 38 const std::vector<const blink::WebInputEvent*>& coalesced_events, | 40 const std::vector<const blink::WebInputEvent*>& coalesced_events, |
| 39 const ui::LatencyInfo& latency_info, | 41 const ui::LatencyInfo& latency_info, |
| 40 InputEventDispatchType dispatch_type); | 42 InputEventDispatchType dispatch_type); |
| 41 | 43 |
| 42 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); | 44 DISALLOW_COPY_AND_ASSIGN(IdleUserDetector); |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 } // namespace content | 47 } // namespace content |
| 46 | 48 |
| 47 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ | 49 #endif // CONTENT_RENDERER_IDLE_USER_DETECTOR_H_ |
| OLD | NEW |