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

Side by Side Diff: content/browser/wake_lock/wake_lock_web_contents_observer.cc

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 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/browser/wake_lock/wake_lock_web_contents_observer.h"
6
7 #include "content/browser/wake_lock/wake_lock_manager.h"
8 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/web_contents.h"
10
11 namespace content {
12
13 WakeLockWebContentsObserver::WakeLockWebContentsObserver(
14 content::WebContents* webContent)
15 : content::WebContentsObserver(webContent) {
16 }
17
18 void WakeLockWebContentsObserver::WasShown() {
19 WakeLockManager::GetInstance()->tabWasShown(
20 web_contents()->GetRenderProcessHost()->GetID(),
21 web_contents()->GetRoutingID());
22 }
23
24 void WakeLockWebContentsObserver::WasHidden() {
25 WakeLockManager::GetInstance()->tabWasHidden(
26 web_contents()->GetRenderProcessHost()->GetID(),
27 web_contents()->GetRoutingID());
28 }
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698