OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/renderer/web_preferences.h" | 5 #include "content/public/renderer/web_preferences.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "third_party/WebKit/public/platform/WebString.h" | 8 #include "third_party/WebKit/public/platform/WebString.h" |
9 #include "third_party/WebKit/public/platform/WebURL.h" | 9 #include "third_party/WebKit/public/platform/WebURL.h" |
10 #include "third_party/WebKit/public/web/WebKit.h" | 10 #include "third_party/WebKit/public/web/WebKit.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 settings->setLocalStorageEnabled(prefs.local_storage_enabled); | 156 settings->setLocalStorageEnabled(prefs.local_storage_enabled); |
157 settings->setSyncXHRInDocumentsEnabled(prefs.sync_xhr_in_documents_enabled); | 157 settings->setSyncXHRInDocumentsEnabled(prefs.sync_xhr_in_documents_enabled); |
158 WebRuntimeFeatures::enableDatabase(prefs.databases_enabled); | 158 WebRuntimeFeatures::enableDatabase(prefs.databases_enabled); |
159 settings->setOfflineWebApplicationCacheEnabled( | 159 settings->setOfflineWebApplicationCacheEnabled( |
160 prefs.application_cache_enabled); | 160 prefs.application_cache_enabled); |
161 settings->setCaretBrowsingEnabled(prefs.caret_browsing_enabled); | 161 settings->setCaretBrowsingEnabled(prefs.caret_browsing_enabled); |
162 settings->setHyperlinkAuditingEnabled(prefs.hyperlink_auditing_enabled); | 162 settings->setHyperlinkAuditingEnabled(prefs.hyperlink_auditing_enabled); |
163 settings->setCookieEnabled(prefs.cookie_enabled); | 163 settings->setCookieEnabled(prefs.cookie_enabled); |
164 settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); | 164 settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); |
165 | 165 |
166 // This setting affects the behavior of links in an editable region: | |
167 // clicking the link should select it rather than navigate to it. | |
168 // Safari uses the same default. It is unlikley an embedder would want to | |
169 // change this, since it would break existing rich text editors. | |
170 settings->setEditableLinkBehaviorNeverLive(); | |
171 | |
172 settings->setJavaEnabled(prefs.java_enabled); | 166 settings->setJavaEnabled(prefs.java_enabled); |
173 | 167 |
174 // By default, allow_universal_access_from_file_urls is set to false and thus | 168 // By default, allow_universal_access_from_file_urls is set to false and thus |
175 // we mitigate attacks from local HTML files by not granting file:// URLs | 169 // we mitigate attacks from local HTML files by not granting file:// URLs |
176 // universal access. Only test shell will enable this. | 170 // universal access. Only test shell will enable this. |
177 settings->setAllowUniversalAccessFromFileURLs( | 171 settings->setAllowUniversalAccessFromFileURLs( |
178 prefs.allow_universal_access_from_file_urls); | 172 prefs.allow_universal_access_from_file_urls); |
179 settings->setAllowFileAccessFromFileURLs( | 173 settings->setAllowFileAccessFromFileURLs( |
180 prefs.allow_file_access_from_file_urls); | 174 prefs.allow_file_access_from_file_urls); |
181 | 175 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 settings->setPinchVirtualViewportEnabled( | 351 settings->setPinchVirtualViewportEnabled( |
358 prefs.pinch_virtual_viewport_enabled); | 352 prefs.pinch_virtual_viewport_enabled); |
359 | 353 |
360 settings->setPinchOverlayScrollbarThickness( | 354 settings->setPinchOverlayScrollbarThickness( |
361 prefs.pinch_overlay_scrollbar_thickness); | 355 prefs.pinch_overlay_scrollbar_thickness); |
362 settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars); | 356 settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars); |
363 settings->setCompositorTouchHitTesting(prefs.compositor_touch_hit_testing); | 357 settings->setCompositorTouchHitTesting(prefs.compositor_touch_hit_testing); |
364 } | 358 } |
365 | 359 |
366 } // namespace content | 360 } // namespace content |
OLD | NEW |