Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 373323003: Cache the current WebPreferences on RenderViewHostImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 // Make sure we will set the default_encoding with canonical encoding name. 2476 // Make sure we will set the default_encoding with canonical encoding name.
2477 web_prefs->default_encoding = 2477 web_prefs->default_encoding =
2478 CharacterEncoding::GetCanonicalEncodingNameByAliasName( 2478 CharacterEncoding::GetCanonicalEncodingNameByAliasName(
2479 web_prefs->default_encoding); 2479 web_prefs->default_encoding);
2480 if (web_prefs->default_encoding.empty()) { 2480 if (web_prefs->default_encoding.empty()) {
2481 prefs->ClearPref(prefs::kDefaultCharset); 2481 prefs->ClearPref(prefs::kDefaultCharset);
2482 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); 2482 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset);
2483 } 2483 }
2484 DCHECK(!web_prefs->default_encoding.empty()); 2484 DCHECK(!web_prefs->default_encoding.empty());
2485 2485
2486 // Note: it's not posible for kExtensionsScheme to change during the lifetime
2487 // of the process.
2486 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); 2488 WebContents* web_contents = WebContents::FromRenderViewHost(rvh);
2487 extensions::ViewType view_type = extensions::GetViewType(web_contents); 2489 extensions::ViewType view_type = extensions::GetViewType(web_contents);
2488 ExtensionService* service = 2490 ExtensionService* service =
2489 extensions::ExtensionSystem::Get(profile)->extension_service(); 2491 extensions::ExtensionSystem::Get(profile)->extension_service();
2490 if (service) { 2492 if (service) {
2491 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); 2493 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL();
2492 const Extension* extension = 2494 const Extension* extension =
2493 service->extensions()->GetByID(site_url.host()); 2495 service->extensions()->GetByID(site_url.host());
2494 // Ensure that we are only granting extension preferences to URLs with 2496 // Ensure that we are only granting extension preferences to URLs with
2495 // the correct scheme. Without this check, chrome-guest:// schemes used by 2497 // the correct scheme. Without this check, chrome-guest:// schemes used by
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 switches::kDisableWebRtcEncryption, 2909 switches::kDisableWebRtcEncryption,
2908 }; 2910 };
2909 to_command_line->CopySwitchesFrom(from_command_line, 2911 to_command_line->CopySwitchesFrom(from_command_line,
2910 kWebRtcDevSwitchNames, 2912 kWebRtcDevSwitchNames,
2911 arraysize(kWebRtcDevSwitchNames)); 2913 arraysize(kWebRtcDevSwitchNames));
2912 } 2914 }
2913 } 2915 }
2914 #endif // defined(ENABLE_WEBRTC) 2916 #endif // defined(ENABLE_WEBRTC)
2915 2917
2916 } // namespace chrome 2918 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698