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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 13877028: Renderer initiated navigations from non instant process should not fall into instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding tests. Created 7 years, 7 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 | Annotate | Revision Log
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 host->Send(new ChromeViewMsg_SetExtensionActivityLogEnabled( 738 host->Send(new ChromeViewMsg_SetExtensionActivityLogEnabled(
739 IsExtensionActivityLogEnabledForProfile(profile))); 739 IsExtensionActivityLogEnabledForProfile(profile)));
740 740
741 SendExtensionWebRequestStatusToHost(host); 741 SendExtensionWebRequestStatusToHost(host);
742 742
743 RendererContentSettingRules rules; 743 RendererContentSettingRules rules;
744 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); 744 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules);
745 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); 745 host->Send(new ChromeViewMsg_SetContentSettingRules(rules));
746 } 746 }
747 747
748 GURL ChromeContentBrowserClient::GetPossiblyPrivilegedURL(
749 content::BrowserContext* browser_context,
750 const GURL& url,
751 bool is_renderer_initiated,
752 content::SiteInstance* curr_instance) {
753 Profile* profile = Profile::FromBrowserContext(browser_context);
754 if (!profile)
755 return url;
756
757 // Only return the privileged instant URL if we are entering from a browser-
758 // initiated navigation or if we are already in the instant process.
759 bool is_instant_process = false;
760 int process_id = curr_instance->GetProcess()->GetID();
761 InstantService* instant_service =
762 InstantServiceFactory::GetForProfile(profile);
763 if (instant_service)
764 is_instant_process = instant_service->IsInstantProcess(process_id);
765 if (!is_renderer_initiated || is_instant_process) {
766 // If the input |url| should be assigned to the Instant renderer, make its
767 // effective URL distinct from other URLs on the search provider's domain.
Charlie Reis 2013/05/01 01:17:54 s/effective/privileged/
Shishir 2013/05/01 07:56:14 Done.
768 if (chrome::ShouldAssignURLToInstantRenderer(url, profile))
769 return GetEffectiveURLForInstant(url, profile);
Charlie Reis 2013/05/01 01:17:54 We should rename this to GetPrivilegedURLForInstan
Shishir 2013/05/01 07:56:14 Done.
770 }
771
772 return url;
773 }
774
748 GURL ChromeContentBrowserClient::GetEffectiveURL( 775 GURL ChromeContentBrowserClient::GetEffectiveURL(
749 content::BrowserContext* browser_context, const GURL& url) { 776 content::BrowserContext* browser_context, const GURL& url) {
750 Profile* profile = Profile::FromBrowserContext(browser_context); 777 Profile* profile = Profile::FromBrowserContext(browser_context);
751 if (!profile) 778 if (!profile)
752 return url; 779 return url;
753 780
754 // If the input |url| should be assigned to the Instant renderer, make its
755 // effective URL distinct from other URLs on the search provider's domain.
756 if (chrome::ShouldAssignURLToInstantRenderer(url, profile))
757 return GetEffectiveURLForInstant(url, profile);
758
759 #if !defined(OS_CHROMEOS) 781 #if !defined(OS_CHROMEOS)
760 // If the input |url| should be assigned to the Signin renderer, make its 782 // If the input |url| should be assigned to the Signin renderer, make its
761 // effective URL distinct from other URLs on the signin service's domain. 783 // effective URL distinct from other URLs on the signin service's domain.
762 // Note that the signin renderer will be allowed to sign the user in to 784 // Note that the signin renderer will be allowed to sign the user in to
763 // Chrome. 785 // Chrome.
764 if (SigninManager::IsWebBasedSigninFlowURL(url)) 786 if (SigninManager::IsWebBasedSigninFlowURL(url))
765 return GetEffectiveURLForSignin(url); 787 return GetEffectiveURLForSignin(url);
766 #endif 788 #endif
767 789
768 // If the input |url| is part of an installed app, the effective URL is an 790 // If the input |url| is part of an installed app, the effective URL is an
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 #if defined(USE_NSS) 2269 #if defined(USE_NSS)
2248 crypto::CryptoModuleBlockingPasswordDelegate* 2270 crypto::CryptoModuleBlockingPasswordDelegate*
2249 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2271 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2250 const GURL& url) { 2272 const GURL& url) {
2251 return chrome::NewCryptoModuleBlockingDialogDelegate( 2273 return chrome::NewCryptoModuleBlockingDialogDelegate(
2252 chrome::kCryptoModulePasswordKeygen, url.host()); 2274 chrome::kCryptoModulePasswordKeygen, url.host());
2253 } 2275 }
2254 #endif 2276 #endif
2255 2277
2256 } // namespace chrome 2278 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698