| 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 c2f46ad2e92a0636387896c85cc32a18753b9447..8f4c5d286b1526f3e50a503b1d43ecc8b6dc6b76 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -88,7 +88,8 @@ void InitRenderViewHostForExtensions(RenderViewHost* render_view_host) {
|
| if (!site.SchemeIs(chrome::kExtensionScheme))
|
| return;
|
|
|
| - Profile* profile = site_instance->browsing_instance()->profile();
|
| + Profile* profile =
|
| + static_cast<Profile*>(site_instance->browsing_instance()->context());
|
| ExtensionService* service = profile->GetExtensionService();
|
| if (!service)
|
| return;
|
| @@ -140,8 +141,8 @@ void InitRenderViewHostForExtensions(RenderViewHost* render_view_host) {
|
| }
|
|
|
| // Handles rewriting Web UI URLs.
|
| -static bool HandleWebUI(GURL* url, Profile* profile) {
|
| - if (!ChromeWebUIFactory::GetInstance()->UseWebUIForURL(profile, *url))
|
| +static bool HandleWebUI(GURL* url, content::BrowserContext* context) {
|
| + if (!ChromeWebUIFactory::GetInstance()->UseWebUIForURL(context, *url))
|
| return false;
|
|
|
| // Special case the new tab page. In older versions of Chrome, the new tab
|
| @@ -172,7 +173,7 @@ void ChromeContentBrowserClient::RenderViewHostCreated(
|
| void ChromeContentBrowserClient::BrowserRenderProcessHostCreated(
|
| BrowserRenderProcessHost* host) {
|
| int id = host->id();
|
| - Profile* profile = host->profile();
|
| + Profile* profile = static_cast<Profile*>(host->context());
|
| host->channel()->AddFilter(new ChromeRenderMessageFilter(
|
| id, profile, profile->GetRequestContextForRenderProcess(id)));
|
| host->channel()->AddFilter(new PrintingMessageFilter());
|
| @@ -200,8 +201,9 @@ content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() {
|
| return ChromeWebUIFactory::GetInstance();
|
| }
|
|
|
| -GURL ChromeContentBrowserClient::GetEffectiveURL(Profile* profile,
|
| - const GURL& url) {
|
| +GURL ChromeContentBrowserClient::GetEffectiveURL(
|
| + content::BrowserContext* context, const GURL& url) {
|
| + Profile* profile = static_cast<Profile*>(context);
|
| // Get the effective URL for the given actual URL. If the 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
|
| @@ -220,14 +222,14 @@ GURL ChromeContentBrowserClient::GetEffectiveURL(Profile* profile,
|
| }
|
|
|
| bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
|
| - Profile* profile,
|
| - const GURL& effective_url) {
|
| + content::BrowserContext* context, const GURL& effective_url) {
|
| // Non-extension URLs should generally use process-per-site-instance.
|
| // Because we expect to use the effective URL, hosted apps URLs should have
|
| // an extension scheme by now.
|
| if (!effective_url.SchemeIs(chrome::kExtensionScheme))
|
| return false;
|
|
|
| + Profile* profile = static_cast<Profile*>(context);
|
| if (!profile || !profile->GetExtensionService())
|
| return false;
|
|
|
| @@ -296,7 +298,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
|
|
|
| RenderProcessHost* process = RenderProcessHost::FromID(child_process_id);
|
|
|
| - PrefService* prefs = process->profile()->GetPrefs();
|
| + Profile* profile = static_cast<Profile*>(process->context());
|
| + PrefService* prefs = profile->GetPrefs();
|
| // Currently this pref is only registered if applied via a policy.
|
| if (prefs->HasPrefPath(prefs::kDisable3DAPIs) &&
|
| prefs->GetBoolean(prefs::kDisable3DAPIs)) {
|
| @@ -390,7 +393,8 @@ std::string ChromeContentBrowserClient::GetApplicationLocale() {
|
| }
|
|
|
| std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) {
|
| - return tab->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
|
| + Profile* profile = static_cast<Profile*>(tab->context());
|
| + return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
|
| }
|
|
|
| SkBitmap* ChromeContentBrowserClient::GetDefaultFavicon() {
|
| @@ -548,8 +552,9 @@ void ChromeContentBrowserClient::RequestDesktopNotificationPermission(
|
| }
|
|
|
| RenderProcessHost* process = rvh->process();
|
| + Profile* profile = static_cast<Profile*>(process->context());
|
| DesktopNotificationService* service =
|
| - DesktopNotificationServiceFactory::GetForProfile(process->profile());
|
| + DesktopNotificationServiceFactory::GetForProfile(profile);
|
| service->RequestPermission(
|
| source_origin, render_process_id, render_view_id, callback_context,
|
| tab_util::GetTabContentsByID(render_process_id, render_view_id));
|
| @@ -590,8 +595,9 @@ void ChromeContentBrowserClient::ShowDesktopNotification(
|
| }
|
|
|
| RenderProcessHost* process = rvh->process();
|
| + Profile* profile = static_cast<Profile*>(process->context());
|
| DesktopNotificationService* service =
|
| - DesktopNotificationServiceFactory::GetForProfile(process->profile());
|
| + DesktopNotificationServiceFactory::GetForProfile(profile);
|
| service->ShowDesktopNotification(
|
| params, render_process_id, render_view_id,
|
| worker ? DesktopNotificationService::WorkerNotification :
|
| @@ -610,8 +616,9 @@ void ChromeContentBrowserClient::CancelDesktopNotification(
|
| }
|
|
|
| RenderProcessHost* process = rvh->process();
|
| + Profile* profile = static_cast<Profile*>(process->context());
|
| DesktopNotificationService* service =
|
| - DesktopNotificationServiceFactory::GetForProfile(process->profile());
|
| + DesktopNotificationServiceFactory::GetForProfile(profile);
|
| service->CancelDesktopNotification(
|
| render_process_id, render_view_id, notification_id);
|
| }
|
| @@ -669,20 +676,20 @@ bool ChromeContentBrowserClient::IsFastShutdownPossible() {
|
| return !browser_command_line.HasSwitch(switches::kChromeFrame);
|
| }
|
|
|
| -WebPreferences ChromeContentBrowserClient::GetWebkitPrefs(Profile* profile,
|
| - bool is_web_ui) {
|
| - return RenderViewHostDelegateHelper::GetWebkitPrefs(profile, is_web_ui);
|
| +WebPreferences ChromeContentBrowserClient::GetWebkitPrefs(
|
| + content::BrowserContext* context, bool is_web_ui) {
|
| + return RenderViewHostDelegateHelper::GetWebkitPrefs(context, is_web_ui);
|
| }
|
|
|
| void ChromeContentBrowserClient::UpdateInspectorSetting(
|
| RenderViewHost* rvh, const std::string& key, const std::string& value) {
|
| RenderViewHostDelegateHelper::UpdateInspectorSetting(
|
| - rvh->process()->profile(), key, value);
|
| + rvh->process()->context(), key, value);
|
| }
|
|
|
| void ChromeContentBrowserClient::ClearInspectorSettings(RenderViewHost* rvh) {
|
| RenderViewHostDelegateHelper::ClearInspectorSettings(
|
| - rvh->process()->profile());
|
| + rvh->process()->context());
|
| }
|
|
|
| void ChromeContentBrowserClient::BrowserURLHandlerCreated(
|
| @@ -702,7 +709,8 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
|
| }
|
|
|
| void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) {
|
| - Profile* profile = rvh->site_instance()->GetProcess()->profile();
|
| + Profile* profile =
|
| + static_cast<Profile*>(rvh->site_instance()->GetProcess()->context());
|
| BrowsingDataRemover* remover = new BrowsingDataRemover(profile,
|
| BrowsingDataRemover::EVERYTHING,
|
| base::Time());
|
| @@ -711,7 +719,8 @@ void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) {
|
| }
|
|
|
| void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) {
|
| - Profile* profile = rvh->site_instance()->GetProcess()->profile();
|
| + Profile* profile =
|
| + static_cast<Profile*>(rvh->site_instance()->GetProcess()->context());
|
| BrowsingDataRemover* remover = new BrowsingDataRemover(profile,
|
| BrowsingDataRemover::EVERYTHING,
|
| base::Time());
|
|
|