| 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 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 // Make sure we will set the default_encoding with canonical encoding name. | 2514 // Make sure we will set the default_encoding with canonical encoding name. |
| 2515 web_prefs->default_encoding = | 2515 web_prefs->default_encoding = |
| 2516 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 2516 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
| 2517 web_prefs->default_encoding); | 2517 web_prefs->default_encoding); |
| 2518 if (web_prefs->default_encoding.empty()) { | 2518 if (web_prefs->default_encoding.empty()) { |
| 2519 prefs->ClearPref(prefs::kDefaultCharset); | 2519 prefs->ClearPref(prefs::kDefaultCharset); |
| 2520 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 2520 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
| 2521 } | 2521 } |
| 2522 DCHECK(!web_prefs->default_encoding.empty()); | 2522 DCHECK(!web_prefs->default_encoding.empty()); |
| 2523 | 2523 |
| 2524 // Note: it's not posible for kExtensionsScheme to change during the lifetime | |
| 2525 // of the process. | |
| 2526 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 2524 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 2527 extensions::ViewType view_type = extensions::GetViewType(web_contents); | 2525 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
| 2528 ExtensionService* service = | 2526 ExtensionService* service = |
| 2529 extensions::ExtensionSystem::Get(profile)->extension_service(); | 2527 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 2530 if (service) { | 2528 if (service) { |
| 2531 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); | 2529 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); |
| 2532 const Extension* extension = | 2530 const Extension* extension = |
| 2533 service->extensions()->GetByID(site_url.host()); | 2531 service->extensions()->GetByID(site_url.host()); |
| 2534 // Ensure that we are only granting extension preferences to URLs with | 2532 // Ensure that we are only granting extension preferences to URLs with |
| 2535 // the correct scheme. Without this check, chrome-guest:// schemes used by | 2533 // the correct scheme. Without this check, chrome-guest:// schemes used by |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 } | 2953 } |
| 2956 #endif // defined(ENABLE_WEBRTC) | 2954 #endif // defined(ENABLE_WEBRTC) |
| 2957 | 2955 |
| 2958 | 2956 |
| 2959 void ChromeContentBrowserClient::NotificationPermissionRequested( | 2957 void ChromeContentBrowserClient::NotificationPermissionRequested( |
| 2960 const base::Closure& callback, bool result) { | 2958 const base::Closure& callback, bool result) { |
| 2961 callback.Run(); | 2959 callback.Run(); |
| 2962 } | 2960 } |
| 2963 | 2961 |
| 2964 } // namespace chrome | 2962 } // namespace chrome |
| OLD | NEW |