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

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 android build. 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 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
2506 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); 2508 WebContents* web_contents = WebContents::FromRenderViewHost(rvh);
2507 extensions::ViewType view_type = extensions::GetViewType(web_contents); 2509 extensions::ViewType view_type = extensions::GetViewType(web_contents);
2508 ExtensionService* service = 2510 ExtensionService* service =
2509 extensions::ExtensionSystem::Get(profile)->extension_service(); 2511 extensions::ExtensionSystem::Get(profile)->extension_service();
2510 if (service) { 2512 if (service) {
2511 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); 2513 const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL();
2512 const Extension* extension = 2514 const Extension* extension =
2513 service->extensions()->GetByID(site_url.host()); 2515 service->extensions()->GetByID(site_url.host());
2514 // Ensure that we are only granting extension preferences to URLs with 2516 // Ensure that we are only granting extension preferences to URLs with
2515 // the correct scheme. Without this check, chrome-guest:// schemes used by 2517 // the correct scheme. Without this check, chrome-guest:// schemes used by
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 switches::kDisableWebRtcEncryption, 2931 switches::kDisableWebRtcEncryption,
2930 }; 2932 };
2931 to_command_line->CopySwitchesFrom(from_command_line, 2933 to_command_line->CopySwitchesFrom(from_command_line,
2932 kWebRtcDevSwitchNames, 2934 kWebRtcDevSwitchNames,
2933 arraysize(kWebRtcDevSwitchNames)); 2935 arraysize(kWebRtcDevSwitchNames));
2934 } 2936 }
2935 } 2937 }
2936 #endif // defined(ENABLE_WEBRTC) 2938 #endif // defined(ENABLE_WEBRTC)
2937 2939
2938 } // namespace chrome 2940 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/voice_search_tab_helper.cc ('k') | chrome/browser/prefs/chrome_pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698