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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 871443004: Expose the visibility state of a frame to the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rfh_isfocused
Patch Set: remove from RFH Created 5 years, 11 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a45399ec4245e8c283c4919377bf3bece0f974c0..cad0a849602c8a05678180086539d16ecf56572b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2605,6 +2605,22 @@ ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess(
render_process_id).get();
}
+bool ChromeContentBrowserClient::IsPrerendering(
+ content::RenderFrameHost* render_frame_host) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ WebContents* web_contents =
+ WebContents::FromRenderFrameHost(render_frame_host);
+ DCHECK(web_contents);
+
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ prerender::PrerenderManager* prerender_manager =
+ prerender::PrerenderManagerFactory::GetForProfile(profile);
+ return prerender_manager &&
+ prerender_manager->IsWebContentsPrerendering(web_contents, nullptr);
+}
+
#if defined(ENABLE_WEBRTC)
void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch(
base::CommandLine* to_command_line,

Powered by Google App Engine
This is Rietveld 408576698