Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Unified Diff: content/renderer/idle_user_detector.cc

Issue 2813683002: Allow MainThreadEventQueue to call the RenderWidget directly. (Closed)
Patch Set: Fix style nits Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/idle_user_detector.h ('k') | content/renderer/input/input_event_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/idle_user_detector.cc
diff --git a/content/renderer/idle_user_detector.cc b/content/renderer/idle_user_detector.cc
index 43979cfb722ebbbb322b822c0d665c78a998475d..4414b9638afd3890978d68137073e086bb11a1ab 100644
--- a/content/renderer/idle_user_detector.cc
+++ b/content/renderer/idle_user_detector.cc
@@ -12,11 +12,9 @@
namespace content {
IdleUserDetector::IdleUserDetector(RenderView* render_view)
- : RenderViewObserver(render_view){
-}
+ : RenderViewObserver(render_view) {}
-IdleUserDetector::~IdleUserDetector() {
-}
+IdleUserDetector::~IdleUserDetector() {}
bool IdleUserDetector::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(IdleUserDetector, message)
@@ -25,11 +23,7 @@ bool IdleUserDetector::OnMessageReceived(const IPC::Message& message) {
return false;
}
-void IdleUserDetector::OnHandleInputEvent(
- const blink::WebInputEvent* event,
- const std::vector<const blink::WebInputEvent*>& coalesced_events,
- const ui::LatencyInfo& latency_info,
- InputEventDispatchType dispatch_type) {
+void IdleUserDetector::ActivityDetected() {
if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
RenderThreadImpl* render_thread = RenderThreadImpl::current();
if (render_thread != NULL) {
@@ -38,8 +32,14 @@ void IdleUserDetector::OnHandleInputEvent(
}
}
-void IdleUserDetector::OnDestruct() {
- delete this;
+void IdleUserDetector::OnHandleInputEvent(
+ const blink::WebInputEvent* event,
+ const std::vector<const blink::WebInputEvent*>& coalesced_events,
+ const ui::LatencyInfo& latency_info,
+ InputEventDispatchType dispatch_type) {
+ ActivityDetected();
}
+void IdleUserDetector::OnDestruct() {}
+
} // namespace content
« no previous file with comments | « content/renderer/idle_user_detector.h ('k') | content/renderer/input/input_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698