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 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 // Make sure we will set the default_encoding with canonical encoding name. | 2496 // Make sure we will set the default_encoding with canonical encoding name. |
2497 web_prefs->default_encoding = | 2497 web_prefs->default_encoding = |
2498 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 2498 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
2499 web_prefs->default_encoding); | 2499 web_prefs->default_encoding); |
2500 if (web_prefs->default_encoding.empty()) { | 2500 if (web_prefs->default_encoding.empty()) { |
2501 prefs->ClearPref(prefs::kDefaultCharset); | 2501 prefs->ClearPref(prefs::kDefaultCharset); |
2502 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 2502 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
2503 } | 2503 } |
2504 DCHECK(!web_prefs->default_encoding.empty()); | 2504 DCHECK(!web_prefs->default_encoding.empty()); |
2505 | 2505 |
2506 // Note: it's not posible for kExtensionsScheme to change during the lifetime | |
2507 // of the process. | |
2508 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 2506 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
2509 extensions::ViewType view_type = extensions::GetViewType(web_contents); | 2507 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
2510 ExtensionService* service = | 2508 ExtensionService* service = |
2511 extensions::ExtensionSystem::Get(profile)->extension_service(); | 2509 extensions::ExtensionSystem::Get(profile)->extension_service(); |
2512 if (service) { | 2510 if (service) { |
2513 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); | 2511 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); |
2514 const Extension* extension = | 2512 const Extension* extension = |
2515 service->extensions()->GetByID(site_url.host()); | 2513 service->extensions()->GetByID(site_url.host()); |
2516 // Ensure that we are only granting extension preferences to URLs with | 2514 // Ensure that we are only granting extension preferences to URLs with |
2517 // the correct scheme. Without this check, chrome-guest:// schemes used by | 2515 // the correct scheme. Without this check, chrome-guest:// schemes used by |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2931 switches::kDisableWebRtcEncryption, | 2929 switches::kDisableWebRtcEncryption, |
2932 }; | 2930 }; |
2933 to_command_line->CopySwitchesFrom(from_command_line, | 2931 to_command_line->CopySwitchesFrom(from_command_line, |
2934 kWebRtcDevSwitchNames, | 2932 kWebRtcDevSwitchNames, |
2935 arraysize(kWebRtcDevSwitchNames)); | 2933 arraysize(kWebRtcDevSwitchNames)); |
2936 } | 2934 } |
2937 } | 2935 } |
2938 #endif // defined(ENABLE_WEBRTC) | 2936 #endif // defined(ENABLE_WEBRTC) |
2939 | 2937 |
2940 } // namespace chrome | 2938 } // namespace chrome |
OLD | NEW |