Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/renderer/idle_user_detector.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "content/common/view_messages.h" | |
| 9 #include "content/public/renderer/content_renderer_client.h" | |
| 10 #include "content/public/renderer/render_thread.h" | |
| 11 | |
| 12 using content::RenderThread; | |
| 13 | |
| 14 IdleUserDetector::IdleUserDetector(content::RenderView* render_view) | |
| 15 : content::RenderViewObserver(render_view){ | |
| 16 } | |
| 17 | |
| 18 IdleUserDetector::~IdleUserDetector() { | |
| 19 } | |
| 20 | |
| 21 bool IdleUserDetector::OnMessageReceived(const IPC::Message& message) { | |
| 22 IPC_BEGIN_MESSAGE_MAP(IdleUserDetector, message) | |
| 23 IPC_MESSAGE_HANDLER(ViewMsg_HandleInputEvent, OnHandleInputEvent) | |
| 24 IPC_END_MESSAGE_MAP() | |
| 25 return false; | |
| 26 } | |
| 27 | |
| 28 void IdleUserDetector::OnHandleInputEvent(const IPC::Message& message) { | |
| 29 if (content::GetContentClient()->renderer()-> | |
| 30 RunIdleHandlerWhenWidgetsHidden()) { | |
|
ulan
2011/11/16 14:14:46
I use "RunIdleHandlerWhenWidgetsHidden" as an indi
Matt Perry
2011/11/16 19:23:52
I think you can just call PostponeIdleNotification
ulan
2011/11/16 20:13:22
I will do it in the second CL which will simplify
| |
| 31 RenderThread::Get()->PostponeIdleNotification(); | |
| 32 } | |
| 33 } | |
| OLD | NEW |