diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-13 15:46:41 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-13 15:46:41 +0000 |
commit | 8830998f7436edb5aabd1a3465d7ba5e7b77fd05 (patch) | |
tree | 7d90b836f05d2b01b1a68b053aeab068efa73501 /chrome/browser/tab_contents/web_contents.cc | |
parent | 0d34712130aaa3982dabb0a34e96a2be85a5f2e1 (diff) | |
download | chromium_src-8830998f7436edb5aabd1a3465d7ba5e7b77fd05.zip chromium_src-8830998f7436edb5aabd1a3465d7ba5e7b77fd05.tar.gz chromium_src-8830998f7436edb5aabd1a3465d7ba5e7b77fd05.tar.bz2 |
Hook up a bit more plumbing to ExtensionView which should allow popup windows and widgets to work.Add in a quick hack that lets you bring up the web inspector.
Review URL: http://codereview.chromium.org/67029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/web_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents/web_contents.cc | 91 |
1 files changed, 3 insertions, 88 deletions
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index b58d7b3..b91c693 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -1335,94 +1335,9 @@ GURL WebContents::GetAlternateErrorPageURL() const { } WebPreferences WebContents::GetWebkitPrefs() { - // Initialize web_preferences_ to chrome defaults. - WebPreferences web_prefs; - PrefService* prefs = profile()->GetPrefs(); - - web_prefs.fixed_font_family = - prefs->GetString(prefs::kWebKitFixedFontFamily); - web_prefs.serif_font_family = - prefs->GetString(prefs::kWebKitSerifFontFamily); - web_prefs.sans_serif_font_family = - prefs->GetString(prefs::kWebKitSansSerifFontFamily); - if (prefs->GetBoolean(prefs::kWebKitStandardFontIsSerif)) - web_prefs.standard_font_family = web_prefs.serif_font_family; - else - web_prefs.standard_font_family = web_prefs.sans_serif_font_family; - web_prefs.cursive_font_family = - prefs->GetString(prefs::kWebKitCursiveFontFamily); - web_prefs.fantasy_font_family = - prefs->GetString(prefs::kWebKitFantasyFontFamily); - - web_prefs.default_font_size = - prefs->GetInteger(prefs::kWebKitDefaultFontSize); - web_prefs.default_fixed_font_size = - prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); - web_prefs.minimum_font_size = - prefs->GetInteger(prefs::kWebKitMinimumFontSize); - web_prefs.minimum_logical_font_size = - prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize); - - web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); - - web_prefs.javascript_can_open_windows_automatically = - prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); - web_prefs.dom_paste_enabled = - prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); - web_prefs.shrinks_standalone_images_to_fit = - prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); - - { // Command line switches are used for preferences with no user interface. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - web_prefs.developer_extras_enabled = - !command_line.HasSwitch(switches::kDisableDevTools) && - prefs->GetBoolean(prefs::kWebKitDeveloperExtrasEnabled); - web_prefs.javascript_enabled = - !command_line.HasSwitch(switches::kDisableJavaScript) && - prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); - web_prefs.web_security_enabled = - !command_line.HasSwitch(switches::kDisableWebSecurity) && - prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled); - web_prefs.plugins_enabled = - !command_line.HasSwitch(switches::kDisablePlugins) && - prefs->GetBoolean(prefs::kWebKitPluginsEnabled); - web_prefs.java_enabled = - !command_line.HasSwitch(switches::kDisableJava) && - prefs->GetBoolean(prefs::kWebKitJavaEnabled); - web_prefs.loads_images_automatically = - !command_line.HasSwitch(switches::kDisableImages) && - prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); - web_prefs.uses_page_cache = - command_line.HasSwitch(switches::kEnableFastback); - } - - web_prefs.uses_universal_detector = - prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); - web_prefs.text_areas_are_resizable = - prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); - - // User CSS is currently disabled because it crashes chrome. See - // webkit/glue/webpreferences.h for more details. - - // Make sure we will set the default_encoding with canonical encoding name. - web_prefs.default_encoding = - CharacterEncoding::GetCanonicalEncodingNameByAliasName( - web_prefs.default_encoding); - if (web_prefs.default_encoding.empty()) { - prefs->ClearPref(prefs::kDefaultCharset); - web_prefs.default_encoding = prefs->GetString( - prefs::kDefaultCharset); - } - DCHECK(!web_prefs.default_encoding.empty()); - - // Override some prefs when we're a DOM UI, or the pages won't work. This is - // called during setup, so we will always use the pending one. - if (render_manager_.pending_dom_ui()) { - web_prefs.loads_images_automatically = true; - web_prefs.javascript_enabled = true; - } - - return web_prefs; + PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); + bool isDomUI = false; + return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, isDomUI); } void WebContents::OnMissingPluginStatus(int status) { |