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); | |
78 | 77 |
79 // We prevent WebKit from checking if it needs to add a "text direction" | 78 // We prevent WebKit from checking if it needs to add a "text direction" |
80 // submenu to a context menu. it is not only because we don't need the result | 79 // submenu to a context menu. it is not only because we don't need the result |
81 // but also because it cause a possible crash in Editor::hasBidiSelection(). | 80 // but also because it cause a possible crash in Editor::hasBidiSelection(). |
82 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); | 81 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); |
83 | 82 |
84 // Enable experimental WebGL support if requested on command line | 83 // Enable experimental WebGL support if requested on command line |
85 // and support is compiled in. | 84 // and support is compiled in. |
86 settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); | 85 settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); |
87 | 86 |
88 // Enable geolocation support if requested on command line and support is | 87 // Enable geolocation support if requested on command line and support is |
89 // compiled in. | 88 // compiled in. |
90 settings->setGeolocationEnabled(geolocation_enabled); | 89 settings->setGeolocationEnabled(geolocation_enabled); |
91 | 90 |
92 // Web inspector settings need to be passed in differently. | 91 // Web inspector settings need to be passed in differently. |
93 web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings)); | 92 web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings)); |
94 | 93 |
95 // Tabs to link is not part of the settings. WebCore calls | 94 // Tabs to link is not part of the settings. WebCore calls |
96 // ChromeClient::tabsToLinks which is part of the glue code. | 95 // ChromeClient::tabsToLinks which is part of the glue code. |
97 web_view->setTabsToLinks(tabs_to_links); | 96 web_view->setTabsToLinks(tabs_to_links); |
98 } | 97 } |
OLD | NEW |