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

Side by Side 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: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 net::CookieStore* 2603 net::CookieStore*
2604 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess( 2604 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess(
2605 int render_process_id) { 2605 int render_process_id) {
2606 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2606 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2607 if (!prerender_tracker_) 2607 if (!prerender_tracker_)
2608 return NULL; 2608 return NULL;
2609 return prerender_tracker_->GetPrerenderCookieStoreForRenderProcess( 2609 return prerender_tracker_->GetPrerenderCookieStoreForRenderProcess(
2610 render_process_id).get(); 2610 render_process_id).get();
2611 } 2611 }
2612 2612
2613 void ChromeContentBrowserClient::OverridePageVisibilityState(
2614 RenderFrameHost* render_frame_host,
2615 blink::WebPageVisibilityState* visibility_state) {
2616 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2617
2618 WebContents* web_contents =
2619 WebContents::FromRenderFrameHost(render_frame_host);
2620 DCHECK(web_contents);
2621
2622 Profile* profile =
2623 Profile::FromBrowserContext(web_contents->GetBrowserContext());
2624 prerender::PrerenderManager* prerender_manager =
2625 prerender::PrerenderManagerFactory::GetForProfile(profile);
2626 if (prerender_manager &&
2627 prerender_manager->IsWebContentsPrerendering(web_contents, nullptr)) {
2628 *visibility_state = blink::WebPageVisibilityStatePrerender;
2629 }
2630 }
2631
2613 #if defined(ENABLE_WEBRTC) 2632 #if defined(ENABLE_WEBRTC)
2614 void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( 2633 void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch(
2615 base::CommandLine* to_command_line, 2634 base::CommandLine* to_command_line,
2616 const base::CommandLine& from_command_line, 2635 const base::CommandLine& from_command_line,
2617 VersionInfo::Channel channel) { 2636 VersionInfo::Channel channel) {
2618 #if defined(OS_ANDROID) 2637 #if defined(OS_ANDROID)
2619 const VersionInfo::Channel kMaxDisableEncryptionChannel = 2638 const VersionInfo::Channel kMaxDisableEncryptionChannel =
2620 VersionInfo::CHANNEL_BETA; 2639 VersionInfo::CHANNEL_BETA;
2621 #else 2640 #else
2622 const VersionInfo::Channel kMaxDisableEncryptionChannel = 2641 const VersionInfo::Channel kMaxDisableEncryptionChannel =
2623 VersionInfo::CHANNEL_DEV; 2642 VersionInfo::CHANNEL_DEV;
2624 #endif 2643 #endif
2625 if (channel <= kMaxDisableEncryptionChannel) { 2644 if (channel <= kMaxDisableEncryptionChannel) {
2626 static const char* const kWebRtcDevSwitchNames[] = { 2645 static const char* const kWebRtcDevSwitchNames[] = {
2627 switches::kDisableWebRtcEncryption, 2646 switches::kDisableWebRtcEncryption,
2628 }; 2647 };
2629 to_command_line->CopySwitchesFrom(from_command_line, 2648 to_command_line->CopySwitchesFrom(from_command_line,
2630 kWebRtcDevSwitchNames, 2649 kWebRtcDevSwitchNames,
2631 arraysize(kWebRtcDevSwitchNames)); 2650 arraysize(kWebRtcDevSwitchNames));
2632 } 2651 }
2633 } 2652 }
2634 #endif // defined(ENABLE_WEBRTC) 2653 #endif // defined(ENABLE_WEBRTC)
2635 2654
2636 } // namespace chrome 2655 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698