| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 861 |
| 862 bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect( | 862 bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect( |
| 863 content::ResourceContext* resource_context, const GURL& current_url, | 863 content::ResourceContext* resource_context, const GURL& current_url, |
| 864 const GURL& new_url) { | 864 const GURL& new_url) { |
| 865 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 865 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 866 return extensions::CrossesExtensionProcessBoundary( | 866 return extensions::CrossesExtensionProcessBoundary( |
| 867 io_data->GetExtensionInfoMap()->extensions(), | 867 io_data->GetExtensionInfoMap()->extensions(), |
| 868 ExtensionURLInfo(current_url), ExtensionURLInfo(new_url), false); | 868 ExtensionURLInfo(current_url), ExtensionURLInfo(new_url), false); |
| 869 } | 869 } |
| 870 | 870 |
| 871 void ChromeContentBrowserClient::GuestWebContentsCreated( |
| 872 WebContents* guest_web_contents, WebContents* embedder_web_contents) { |
| 873 Profile* profile = Profile::FromBrowserContext( |
| 874 embedder_web_contents->GetBrowserContext()); |
| 875 ExtensionService* service = |
| 876 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 877 if (!service) |
| 878 return; |
| 879 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL(); |
| 880 const Extension* extension = service->extensions()-> |
| 881 GetExtensionOrAppByURL(ExtensionURLInfo(url)); |
| 882 if (!extension) |
| 883 return; |
| 884 std::vector<ExtensionMsg_Loaded_Params> extensions; |
| 885 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); |
| 886 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); |
| 887 } |
| 888 |
| 871 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 889 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 872 const std::string& alias_name) { | 890 const std::string& alias_name) { |
| 873 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 891 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); |
| 874 } | 892 } |
| 875 | 893 |
| 876 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( | 894 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| 877 CommandLine* command_line, int child_process_id) { | 895 CommandLine* command_line, int child_process_id) { |
| 878 #if defined(USE_LINUX_BREAKPAD) | 896 #if defined(USE_LINUX_BREAKPAD) |
| 879 if (IsCrashReporterEnabled()) { | 897 if (IsCrashReporterEnabled()) { |
| 880 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, | 898 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 io_thread_application_locale_ = locale; | 1920 io_thread_application_locale_ = locale; |
| 1903 } | 1921 } |
| 1904 | 1922 |
| 1905 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1923 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 1906 const std::string& locale) { | 1924 const std::string& locale) { |
| 1907 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1925 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1908 io_thread_application_locale_ = locale; | 1926 io_thread_application_locale_ = locale; |
| 1909 } | 1927 } |
| 1910 | 1928 |
| 1911 } // namespace chrome | 1929 } // namespace chrome |
| OLD | NEW |