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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 databases_enabled(false), | 53 databases_enabled(false), |
54 application_cache_enabled(false), | 54 application_cache_enabled(false), |
55 tabs_to_links(true), | 55 tabs_to_links(true), |
56 caret_browsing_enabled(false), | 56 caret_browsing_enabled(false), |
57 hyperlink_auditing_enabled(true), | 57 hyperlink_auditing_enabled(true), |
58 user_style_sheet_enabled(false), | 58 user_style_sheet_enabled(false), |
59 author_and_user_styles_enabled(true), | 59 author_and_user_styles_enabled(true), |
60 frame_flattening_enabled(false), | 60 frame_flattening_enabled(false), |
61 allow_universal_access_from_file_urls(false), | 61 allow_universal_access_from_file_urls(false), |
62 allow_file_access_from_file_urls(false), | 62 allow_file_access_from_file_urls(false), |
63 webaudio_enabled(false), | |
64 experimental_webgl_enabled(false), | 63 experimental_webgl_enabled(false), |
65 show_composited_layer_borders(false), | 64 show_composited_layer_borders(false), |
66 accelerated_compositing_enabled(false), | 65 accelerated_compositing_enabled(false), |
67 accelerated_layers_enabled(false), | 66 accelerated_layers_enabled(false), |
68 accelerated_video_enabled(false), | 67 accelerated_video_enabled(false), |
69 accelerated_2d_canvas_enabled(false), | 68 accelerated_2d_canvas_enabled(false), |
70 accelerated_plugins_enabled(false), | 69 accelerated_plugins_enabled(false), |
71 memory_info_enabled(false), | 70 memory_info_enabled(false), |
72 interactive_form_validation_enabled(true) { | 71 interactive_form_validation_enabled(true) { |
73 } | 72 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // universal access. Only test shell will enable this. | 135 // universal access. Only test shell will enable this. |
137 settings->setAllowUniversalAccessFromFileURLs( | 136 settings->setAllowUniversalAccessFromFileURLs( |
138 allow_universal_access_from_file_urls); | 137 allow_universal_access_from_file_urls); |
139 settings->setAllowFileAccessFromFileURLs(allow_file_access_from_file_urls); | 138 settings->setAllowFileAccessFromFileURLs(allow_file_access_from_file_urls); |
140 | 139 |
141 // We prevent WebKit from checking if it needs to add a "text direction" | 140 // We prevent WebKit from checking if it needs to add a "text direction" |
142 // submenu to a context menu. it is not only because we don't need the result | 141 // submenu to a context menu. it is not only because we don't need the result |
143 // but also because it cause a possible crash in Editor::hasBidiSelection(). | 142 // but also because it cause a possible crash in Editor::hasBidiSelection(). |
144 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); | 143 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); |
145 | 144 |
146 #ifdef HAS_WEBAUDIO_FEATURE_ENABLE | |
147 // Enable the web audio API if requested on the command line. | |
148 settings->setWebAudioEnabled(webaudio_enabled); | |
149 #endif // HAS_WEBAUDIO_FEATURE_ENABLE | |
150 | |
151 // Enable experimental WebGL support if requested on command line | 145 // Enable experimental WebGL support if requested on command line |
152 // and support is compiled in. | 146 // and support is compiled in. |
153 bool enable_webgl = | 147 bool enable_webgl = |
154 WebRuntimeFeatures::isWebGLEnabled() && experimental_webgl_enabled; | 148 WebRuntimeFeatures::isWebGLEnabled() && experimental_webgl_enabled; |
155 settings->setExperimentalWebGLEnabled(enable_webgl); | 149 settings->setExperimentalWebGLEnabled(enable_webgl); |
156 | 150 |
157 // Display colored borders around composited render layers if requested | 151 // Display colored borders around composited render layers if requested |
158 // on command line. | 152 // on command line. |
159 settings->setShowDebugBorders(show_composited_layer_borders); | 153 settings->setShowDebugBorders(show_composited_layer_borders); |
160 | 154 |
(...skipping 28 matching lines...) Expand all Loading... |
189 web_view->setInspectorSetting(WebString::fromUTF8(it->first), | 183 web_view->setInspectorSetting(WebString::fromUTF8(it->first), |
190 WebString::fromUTF8(it->second)); | 184 WebString::fromUTF8(it->second)); |
191 | 185 |
192 // Tabs to link is not part of the settings. WebCore calls | 186 // Tabs to link is not part of the settings. WebCore calls |
193 // ChromeClient::tabsToLinks which is part of the glue code. | 187 // ChromeClient::tabsToLinks which is part of the glue code. |
194 web_view->setTabsToLinks(tabs_to_links); | 188 web_view->setTabsToLinks(tabs_to_links); |
195 | 189 |
196 settings->setInteractiveFormValidationEnabled( | 190 settings->setInteractiveFormValidationEnabled( |
197 interactive_form_validation_enabled); | 191 interactive_form_validation_enabled); |
198 } | 192 } |
OLD | NEW |