| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
| 9 #include "chrome/browser/browser_about_handler.h" | 9 #include "chrome/browser/browser_about_handler.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| 242 | 242 |
| 243 bool ChromeContentBrowserClient::IsURLSameAsAnySiteInstance(const GURL& url) { | 243 bool ChromeContentBrowserClient::IsURLSameAsAnySiteInstance(const GURL& url) { |
| 244 return url == GURL(chrome::kChromeUICrashURL) || | 244 return url == GURL(chrome::kChromeUICrashURL) || |
| 245 url == GURL(chrome::kChromeUIKillURL) || | 245 url == GURL(chrome::kChromeUIKillURL) || |
| 246 url == GURL(chrome::kChromeUIHangURL) || | 246 url == GURL(chrome::kChromeUIHangURL) || |
| 247 url == GURL(chrome::kChromeUIShorthangURL); | 247 url == GURL(chrome::kChromeUIShorthangURL); |
| 248 } | 248 } |
| 249 | 249 |
| 250 bool ChromeContentBrowserClient::ShouldRunInPrivilegedProcess(const GURL& url) { |
| 251 return url.SchemeIs(chrome::kExtensionScheme); |
| 252 } |
| 253 |
| 254 bool ChromeContentBrowserClient::IsSuitableHost( |
| 255 RenderProcessHost* process_host, |
| 256 const GURL& site_url) { |
| 257 Profile* profile = |
| 258 Profile::FromBrowserContext(process_host->browser_context()); |
| 259 ExtensionProcessManager* process_manager = |
| 260 profile->GetExtensionProcessManager(); |
| 261 CHECK(process_manager); |
| 262 |
| 263 bool is_extension_host = |
| 264 process_host->is_extension_process() || |
| 265 process_manager->IsProcessHostWithBindings(process_host->id()); |
| 266 return site_url.SchemeIs(chrome::kExtensionScheme) == is_extension_host; |
| 267 } |
| 268 |
| 250 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 269 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 251 const std::string& alias_name) { | 270 const std::string& alias_name) { |
| 252 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 271 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); |
| 253 } | 272 } |
| 254 | 273 |
| 255 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( | 274 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| 256 CommandLine* command_line, int child_process_id) { | 275 CommandLine* command_line, int child_process_id) { |
| 257 #if defined(USE_LINUX_BREAKPAD) | 276 #if defined(USE_LINUX_BREAKPAD) |
| 258 if (IsCrashReporterEnabled()) { | 277 if (IsCrashReporterEnabled()) { |
| 259 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, | 278 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 #if defined(USE_NSS) | 832 #if defined(USE_NSS) |
| 814 crypto::CryptoModuleBlockingPasswordDelegate* | 833 crypto::CryptoModuleBlockingPasswordDelegate* |
| 815 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 834 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 816 const GURL& url) { | 835 const GURL& url) { |
| 817 return browser::NewCryptoModuleBlockingDialogDelegate( | 836 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 818 browser::kCryptoModulePasswordKeygen, url.host()); | 837 browser::kCryptoModulePasswordKeygen, url.host()); |
| 819 } | 838 } |
| 820 #endif | 839 #endif |
| 821 | 840 |
| 822 } // namespace chrome | 841 } // namespace chrome |
| OLD | NEW |