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

Side by Side Diff: content/renderer/idle_user_detector.cc

Issue 8513008: Schedule idle handler in the foreground tab based on CPU usage and user activity. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698