OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 site_specific_quirks_enabled(false), | 42 site_specific_quirks_enabled(false), |
43 shrinks_standalone_images_to_fit(true), | 43 shrinks_standalone_images_to_fit(true), |
44 uses_universal_detector(false), // Disabled: page cycler regression | 44 uses_universal_detector(false), // Disabled: page cycler regression |
45 text_areas_are_resizable(true), | 45 text_areas_are_resizable(true), |
46 java_enabled(true), | 46 java_enabled(true), |
47 allow_scripts_to_close_windows(false), | 47 allow_scripts_to_close_windows(false), |
48 uses_page_cache(false), | 48 uses_page_cache(false), |
49 remote_fonts_enabled(true), | 49 remote_fonts_enabled(true), |
50 javascript_can_access_clipboard(false), | 50 javascript_can_access_clipboard(false), |
51 xss_auditor_enabled(false), | 51 xss_auditor_enabled(false), |
| 52 dns_prefetching_enabled(true), |
52 local_storage_enabled(false), | 53 local_storage_enabled(false), |
53 databases_enabled(false), | 54 databases_enabled(false), |
54 application_cache_enabled(false), | 55 application_cache_enabled(false), |
55 tabs_to_links(true), | 56 tabs_to_links(true), |
56 caret_browsing_enabled(false), | 57 caret_browsing_enabled(false), |
57 hyperlink_auditing_enabled(true), | 58 hyperlink_auditing_enabled(true), |
58 user_style_sheet_enabled(false), | 59 user_style_sheet_enabled(false), |
59 author_and_user_styles_enabled(true), | 60 author_and_user_styles_enabled(true), |
60 frame_flattening_enabled(false), | 61 frame_flattening_enabled(false), |
61 allow_universal_access_from_file_urls(false), | 62 allow_universal_access_from_file_urls(false), |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 settings->setAllowScriptsToCloseWindows(allow_scripts_to_close_windows); | 114 settings->setAllowScriptsToCloseWindows(allow_scripts_to_close_windows); |
114 if (user_style_sheet_enabled) | 115 if (user_style_sheet_enabled) |
115 settings->setUserStyleSheetLocation(user_style_sheet_location); | 116 settings->setUserStyleSheetLocation(user_style_sheet_location); |
116 else | 117 else |
117 settings->setUserStyleSheetLocation(WebURL()); | 118 settings->setUserStyleSheetLocation(WebURL()); |
118 settings->setAuthorAndUserStylesEnabled(author_and_user_styles_enabled); | 119 settings->setAuthorAndUserStylesEnabled(author_and_user_styles_enabled); |
119 settings->setUsesPageCache(uses_page_cache); | 120 settings->setUsesPageCache(uses_page_cache); |
120 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled); | 121 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled); |
121 settings->setJavaScriptCanAccessClipboard(javascript_can_access_clipboard); | 122 settings->setJavaScriptCanAccessClipboard(javascript_can_access_clipboard); |
122 settings->setXSSAuditorEnabled(xss_auditor_enabled); | 123 settings->setXSSAuditorEnabled(xss_auditor_enabled); |
| 124 settings->setDNSPrefetchingEnabled(dns_prefetching_enabled); |
123 settings->setLocalStorageEnabled(local_storage_enabled); | 125 settings->setLocalStorageEnabled(local_storage_enabled); |
124 WebRuntimeFeatures::enableDatabase( | 126 WebRuntimeFeatures::enableDatabase( |
125 WebRuntimeFeatures::isDatabaseEnabled() || databases_enabled); | 127 WebRuntimeFeatures::isDatabaseEnabled() || databases_enabled); |
126 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); | 128 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); |
127 settings->setCaretBrowsingEnabled(caret_browsing_enabled); | 129 settings->setCaretBrowsingEnabled(caret_browsing_enabled); |
128 settings->setHyperlinkAuditingEnabled(hyperlink_auditing_enabled); | 130 settings->setHyperlinkAuditingEnabled(hyperlink_auditing_enabled); |
129 | 131 |
130 // This setting affects the behavior of links in an editable region: | 132 // This setting affects the behavior of links in an editable region: |
131 // clicking the link should select it rather than navigate to it. | 133 // clicking the link should select it rather than navigate to it. |
132 // Safari uses the same default. It is unlikley an embedder would want to | 134 // Safari uses the same default. It is unlikley an embedder would want to |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // ChromeClient::tabsToLinks which is part of the glue code. | 223 // ChromeClient::tabsToLinks which is part of the glue code. |
222 web_view->setTabsToLinks(tabs_to_links); | 224 web_view->setTabsToLinks(tabs_to_links); |
223 | 225 |
224 settings->setInteractiveFormValidationEnabled( | 226 settings->setInteractiveFormValidationEnabled( |
225 interactive_form_validation_enabled); | 227 interactive_form_validation_enabled); |
226 | 228 |
227 settings->setFullScreenEnabled(fullscreen_enabled); | 229 settings->setFullScreenEnabled(fullscreen_enabled); |
228 settings->setAllowDisplayOfInsecureContent(allow_displaying_insecure_content); | 230 settings->setAllowDisplayOfInsecureContent(allow_displaying_insecure_content); |
229 settings->setAllowRunningOfInsecureContent(allow_running_insecure_content); | 231 settings->setAllowRunningOfInsecureContent(allow_running_insecure_content); |
230 } | 232 } |
OLD | NEW |