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 "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebSettings.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebSettings.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 settings->setJavaEnabled(java_enabled); | 67 settings->setJavaEnabled(java_enabled); |
68 | 68 |
69 // Turn this on to cause WebCore to paint the resize corner for us. | 69 // Turn this on to cause WebCore to paint the resize corner for us. |
70 settings->setShouldPaintCustomScrollbars(true); | 70 settings->setShouldPaintCustomScrollbars(true); |
71 | 71 |
72 // By default, allow_universal_access_from_file_urls is set to false and thus | 72 // By default, allow_universal_access_from_file_urls is set to false and thus |
73 // we mitigate attacks from local HTML files by not granting file:// URLs | 73 // we mitigate attacks from local HTML files by not granting file:// URLs |
74 // universal access. Only test shell will enable this. | 74 // universal access. Only test shell will enable this. |
75 settings->setAllowUniversalAccessFromFileURLs( | 75 settings->setAllowUniversalAccessFromFileURLs( |
76 allow_universal_access_from_file_urls); | 76 allow_universal_access_from_file_urls); |
| 77 settings->setAllowFileAccessFromFileURLs(allow_file_access_from_file_urls); |
77 | 78 |
78 // We prevent WebKit from checking if it needs to add a "text direction" | 79 // We prevent WebKit from checking if it needs to add a "text direction" |
79 // submenu to a context menu. it is not only because we don't need the result | 80 // submenu to a context menu. it is not only because we don't need the result |
80 // but also because it cause a possible crash in Editor::hasBidiSelection(). | 81 // but also because it cause a possible crash in Editor::hasBidiSelection(). |
81 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); | 82 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); |
82 | 83 |
83 // Enable experimental WebGL support if requested on command line | 84 // Enable experimental WebGL support if requested on command line |
84 // and support is compiled in. | 85 // and support is compiled in. |
85 settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); | 86 settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); |
86 | 87 |
87 // Enable geolocation support if requested on command line and support is | 88 // Enable geolocation support if requested on command line and support is |
88 // compiled in. | 89 // compiled in. |
89 settings->setGeolocationEnabled(geolocation_enabled); | 90 settings->setGeolocationEnabled(geolocation_enabled); |
90 | 91 |
91 // Web inspector settings need to be passed in differently. | 92 // Web inspector settings need to be passed in differently. |
92 web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings)); | 93 web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings)); |
93 | 94 |
94 // Tabs to link is not part of the settings. WebCore calls | 95 // Tabs to link is not part of the settings. WebCore calls |
95 // ChromeClient::tabsToLinks which is part of the glue code. | 96 // ChromeClient::tabsToLinks which is part of the glue code. |
96 web_view->setTabsToLinks(tabs_to_links); | 97 web_view->setTabsToLinks(tabs_to_links); |
97 } | 98 } |
OLD | NEW |