OLD | NEW |
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 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 net::CookieStore* | 2598 net::CookieStore* |
2599 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess( | 2599 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess( |
2600 int render_process_id) { | 2600 int render_process_id) { |
2601 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2601 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2602 if (!prerender_tracker_) | 2602 if (!prerender_tracker_) |
2603 return NULL; | 2603 return NULL; |
2604 return prerender_tracker_->GetPrerenderCookieStoreForRenderProcess( | 2604 return prerender_tracker_->GetPrerenderCookieStoreForRenderProcess( |
2605 render_process_id).get(); | 2605 render_process_id).get(); |
2606 } | 2606 } |
2607 | 2607 |
| 2608 bool ChromeContentBrowserClient::IsPrerendering( |
| 2609 content::RenderFrameHost* render_frame_host) { |
| 2610 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2611 |
| 2612 WebContents* web_contents = |
| 2613 WebContents::FromRenderFrameHost(render_frame_host); |
| 2614 DCHECK(web_contents); |
| 2615 |
| 2616 Profile* profile = |
| 2617 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 2618 prerender::PrerenderManager* prerender_manager = |
| 2619 prerender::PrerenderManagerFactory::GetForProfile(profile); |
| 2620 return prerender_manager && |
| 2621 prerender_manager->IsWebContentsPrerendering(web_contents, nullptr); |
| 2622 } |
| 2623 |
2608 #if defined(ENABLE_WEBRTC) | 2624 #if defined(ENABLE_WEBRTC) |
2609 void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( | 2625 void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( |
2610 base::CommandLine* to_command_line, | 2626 base::CommandLine* to_command_line, |
2611 const base::CommandLine& from_command_line, | 2627 const base::CommandLine& from_command_line, |
2612 VersionInfo::Channel channel) { | 2628 VersionInfo::Channel channel) { |
2613 #if defined(OS_ANDROID) | 2629 #if defined(OS_ANDROID) |
2614 const VersionInfo::Channel kMaxDisableEncryptionChannel = | 2630 const VersionInfo::Channel kMaxDisableEncryptionChannel = |
2615 VersionInfo::CHANNEL_BETA; | 2631 VersionInfo::CHANNEL_BETA; |
2616 #else | 2632 #else |
2617 const VersionInfo::Channel kMaxDisableEncryptionChannel = | 2633 const VersionInfo::Channel kMaxDisableEncryptionChannel = |
2618 VersionInfo::CHANNEL_DEV; | 2634 VersionInfo::CHANNEL_DEV; |
2619 #endif | 2635 #endif |
2620 if (channel <= kMaxDisableEncryptionChannel) { | 2636 if (channel <= kMaxDisableEncryptionChannel) { |
2621 static const char* const kWebRtcDevSwitchNames[] = { | 2637 static const char* const kWebRtcDevSwitchNames[] = { |
2622 switches::kDisableWebRtcEncryption, | 2638 switches::kDisableWebRtcEncryption, |
2623 }; | 2639 }; |
2624 to_command_line->CopySwitchesFrom(from_command_line, | 2640 to_command_line->CopySwitchesFrom(from_command_line, |
2625 kWebRtcDevSwitchNames, | 2641 kWebRtcDevSwitchNames, |
2626 arraysize(kWebRtcDevSwitchNames)); | 2642 arraysize(kWebRtcDevSwitchNames)); |
2627 } | 2643 } |
2628 } | 2644 } |
2629 #endif // defined(ENABLE_WEBRTC) | 2645 #endif // defined(ENABLE_WEBRTC) |
2630 | 2646 |
2631 } // namespace chrome | 2647 } // namespace chrome |
OLD | NEW |