OLD | NEW |
(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 } |
OLD | NEW |