Chromium Code Reviews| 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 9677f919fc9dce37e08db35a626aebaf185f6ed4..4f1002774c9e30d0add5a447f964fe6fd6ffb49c 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -64,6 +64,8 @@ |
| #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h" |
| #include "chrome/browser/search_engines/search_provider_install_state_message_filter.h" |
| +#include "chrome/browser/signin/signin_manager.h" |
| +#include "chrome/browser/signin/signin_manager_factory.h" |
| #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
| #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
| #include "chrome/browser/ssl/ssl_add_certificate.h" |
| @@ -75,6 +77,7 @@ |
| #include "chrome/browser/ui/search/search.h" |
| #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| +#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| #include "chrome/browser/user_style_sheet_watcher.h" |
| #include "chrome/browser/user_style_sheet_watcher_factory.h" |
| #include "chrome/browser/view_type_utils.h" |
| @@ -695,6 +698,13 @@ GURL ChromeContentBrowserClient::GetEffectiveURL( |
| if (chrome::search::ShouldAssignURLToInstantRenderer(url, profile)) |
| return GetEffectiveURLForInstant(url, profile); |
| + // If the input |url| should be assigned to the Signin renderer, make its |
| + // effective URL distinct from other URLs on the signin service's domain. |
| + // Note that the signin renderer will be allowed to sign the user in to |
| + // Chrome. |
| + if (SyncPromoUI::IsWebBasedSigninFlowURL(url)) |
| + return GURL(SyncPromoUI::kChromeSigninEffectiveURL); |
|
Charlie Reis
2013/03/06 00:14:54
This seems like it would cause problems, since you
tim (not reviewing)
2013/03/06 01:04:08
The happy case worked as is, although it does seem
|
| + |
| // If the input |url| is part of an installed app, the effective URL is an |
| // extension URL with the ID of that extension as the host. This has the |
| // effect of grouping apps together in a common SiteInstance. |
| @@ -732,6 +742,9 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite( |
| if (chrome::search::ShouldAssignURLToInstantRenderer(effective_url, profile)) |
| return true; |
| + if (SyncPromoUI::IsWebBasedSigninFlowURL(effective_url)) |
| + return true; |
| + |
| if (!effective_url.SchemeIs(extensions::kExtensionScheme)) |
| return false; |
| @@ -829,6 +842,10 @@ bool ChromeContentBrowserClient::IsSuitableHost( |
| instant_service->IsInstantProcess(process_host->GetID())) |
| return chrome::search::ShouldAssignURLToInstantRenderer(site_url, profile); |
| + SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile); |
| + if (signin_manager && signin_manager->IsSigninProcess(process_host->GetID())) |
| + return SyncPromoUI::IsWebBasedSigninFlowURL(site_url); |
| + |
| ExtensionService* service = |
| extensions::ExtensionSystem::Get(profile)->extension_service(); |
| extensions::ProcessMap* process_map = service->process_map(); |
| @@ -925,6 +942,16 @@ void ChromeContentBrowserClient::SiteInstanceGotProcess( |
| instant_service->AddInstantProcess(site_instance->GetProcess()->GetID()); |
| } |
| + // We only expect there to be one signin process as we use process-per-site |
| + // for signin URLs. The signin process will be cleared from SigninManager |
| + // when the renderer is destroyed. |
| + if (SyncPromoUI::IsWebBasedSigninFlowURL(site_instance->GetSiteURL())) { |
| + SigninManager* signin_manager = |
| + SigninManagerFactory::GetForProfile(profile); |
| + if (signin_manager) |
| + signin_manager->SetSigninProcess(site_instance->GetProcess()->GetID()); |
| + } |
| + |
| ExtensionService* service = |
| extensions::ExtensionSystem::Get(profile)->extension_service(); |
| if (!service) |
| @@ -1111,6 +1138,11 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| if (instant_service && |
| instant_service->IsInstantProcess(process->GetID())) |
| command_line->AppendSwitch(switches::kInstantProcess); |
| + |
| + SigninManager* signin_manager = |
| + SigninManagerFactory::GetForProfile(profile); |
| + if (signin_manager && signin_manager->IsSigninProcess(process->GetID())) |
| + command_line->AppendSwitch(switches::kSigninProcess); |
| } |
| if (content::IsThreadedCompositingEnabled()) |