OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/glue/webpreferences.h" | 5 #include "webkit/glue/webpreferences.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 settings->setUserStyleSheetLocation(WebURL()); | 52 settings->setUserStyleSheetLocation(WebURL()); |
53 settings->setAuthorAndUserStylesEnabled(author_and_user_styles_enabled); | 53 settings->setAuthorAndUserStylesEnabled(author_and_user_styles_enabled); |
54 settings->setUsesPageCache(uses_page_cache); | 54 settings->setUsesPageCache(uses_page_cache); |
55 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled); | 55 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled); |
56 settings->setJavaScriptCanAccessClipboard(javascript_can_access_clipboard); | 56 settings->setJavaScriptCanAccessClipboard(javascript_can_access_clipboard); |
57 settings->setXSSAuditorEnabled(xss_auditor_enabled); | 57 settings->setXSSAuditorEnabled(xss_auditor_enabled); |
58 settings->setLocalStorageEnabled(local_storage_enabled); | 58 settings->setLocalStorageEnabled(local_storage_enabled); |
59 WebRuntimeFeatures::enableDatabase( | 59 WebRuntimeFeatures::enableDatabase( |
60 WebRuntimeFeatures::isDatabaseEnabled() || databases_enabled); | 60 WebRuntimeFeatures::isDatabaseEnabled() || databases_enabled); |
61 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); | 61 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); |
62 settings->setHTML5ParserEnabled(enable_html5_parser); | |
63 | 62 |
64 // This setting affects the behavior of links in an editable region: | 63 // This setting affects the behavior of links in an editable region: |
65 // clicking the link should select it rather than navigate to it. | 64 // clicking the link should select it rather than navigate to it. |
66 // Safari uses the same default. It is unlikley an embedder would want to | 65 // Safari uses the same default. It is unlikley an embedder would want to |
67 // change this, since it would break existing rich text editors. | 66 // change this, since it would break existing rich text editors. |
68 settings->setEditableLinkBehaviorNeverLive(); | 67 settings->setEditableLinkBehaviorNeverLive(); |
69 | 68 |
70 settings->setFontRenderingModeNormal(); | 69 settings->setFontRenderingModeNormal(); |
71 settings->setJavaEnabled(java_enabled); | 70 settings->setJavaEnabled(java_enabled); |
72 | 71 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 104 |
106 for (WebInspectorPreferences::const_iterator it = inspector_settings.begin(); | 105 for (WebInspectorPreferences::const_iterator it = inspector_settings.begin(); |
107 it != inspector_settings.end(); ++it) | 106 it != inspector_settings.end(); ++it) |
108 web_view->setInspectorSetting(WebString::fromUTF8(it->first), | 107 web_view->setInspectorSetting(WebString::fromUTF8(it->first), |
109 WebString::fromUTF8(it->second)); | 108 WebString::fromUTF8(it->second)); |
110 | 109 |
111 // Tabs to link is not part of the settings. WebCore calls | 110 // Tabs to link is not part of the settings. WebCore calls |
112 // ChromeClient::tabsToLinks which is part of the glue code. | 111 // ChromeClient::tabsToLinks which is part of the glue code. |
113 web_view->setTabsToLinks(tabs_to_links); | 112 web_view->setTabsToLinks(tabs_to_links); |
114 } | 113 } |
OLD | NEW |