Chromium Code Reviews

Side by Side Diff: webkit/glue/webpreferences.cc

Issue 173306: Force databases and localstorage to be enabled extensions. (Closed)
Patch Set: cleanup Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 "webkit/api/public/WebKit.h" 8 #include "webkit/api/public/WebKit.h"
9 #include "webkit/api/public/WebSettings.h" 9 #include "webkit/api/public/WebSettings.h"
10 #include "webkit/api/public/WebString.h" 10 #include "webkit/api/public/WebString.h"
(...skipping 30 matching lines...)
41 settings->setTextAreasAreResizable(text_areas_are_resizable); 41 settings->setTextAreasAreResizable(text_areas_are_resizable);
42 settings->setAllowScriptsToCloseWindows(allow_scripts_to_close_windows); 42 settings->setAllowScriptsToCloseWindows(allow_scripts_to_close_windows);
43 if (user_style_sheet_enabled) 43 if (user_style_sheet_enabled)
44 settings->setUserStyleSheetLocation(user_style_sheet_location); 44 settings->setUserStyleSheetLocation(user_style_sheet_location);
45 else 45 else
46 settings->setUserStyleSheetLocation(WebURL()); 46 settings->setUserStyleSheetLocation(WebURL());
47 settings->setUsesPageCache(uses_page_cache); 47 settings->setUsesPageCache(uses_page_cache);
48 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled); 48 settings->setDownloadableBinaryFontsEnabled(remote_fonts_enabled);
49 settings->setXSSAuditorEnabled(xss_auditor_enabled); 49 settings->setXSSAuditorEnabled(xss_auditor_enabled);
50 settings->setLocalStorageEnabled(local_storage_enabled); 50 settings->setLocalStorageEnabled(local_storage_enabled);
51 settings->setDatabasesEnabled(WebKit::databasesEnabled() || databases_enabled) ;
Erik does not do reviews 2009/08/24 23:25:26 80 cols
51 settings->setSessionStorageEnabled(session_storage_enabled); 52 settings->setSessionStorageEnabled(session_storage_enabled);
52 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); 53 settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled);
53 54
54 // This setting affects the behavior of links in an editable region: 55 // This setting affects the behavior of links in an editable region:
55 // clicking the link should select it rather than navigate to it. 56 // clicking the link should select it rather than navigate to it.
56 // Safari uses the same default. It is unlikley an embedder would want to 57 // Safari uses the same default. It is unlikley an embedder would want to
57 // change this, since it would break existing rich text editors. 58 // change this, since it would break existing rich text editors.
58 settings->setEditableLinkBehaviorNeverLive(); 59 settings->setEditableLinkBehaviorNeverLive();
59 60
60 settings->setFontRenderingModeNormal(); 61 settings->setFontRenderingModeNormal();
61 settings->setJavaEnabled(java_enabled); 62 settings->setJavaEnabled(java_enabled);
62 63
63 // Turn this on to cause WebCore to paint the resize corner for us. 64 // Turn this on to cause WebCore to paint the resize corner for us.
64 settings->setShouldPaintCustomScrollbars(true); 65 settings->setShouldPaintCustomScrollbars(true);
65 66
66 settings->setDatabasesEnabled(WebKit::databasesEnabled());
67
68 // Mitigate attacks from local HTML files by not granting file:// URLs 67 // Mitigate attacks from local HTML files by not granting file:// URLs
69 // universal access. 68 // universal access.
70 settings->setAllowUniversalAccessFromFileURLs(false); 69 settings->setAllowUniversalAccessFromFileURLs(false);
71 70
72 // We prevent WebKit from checking if it needs to add a "text direction" 71 // We prevent WebKit from checking if it needs to add a "text direction"
73 // submenu to a context menu. it is not only because we don't need the result 72 // submenu to a context menu. it is not only because we don't need the result
74 // but also because it cause a possible crash in Editor::hasBidiSelection(). 73 // but also because it cause a possible crash in Editor::hasBidiSelection().
75 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); 74 settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
76 75
77 // Web inspector settings need to be passed in differently. 76 // Web inspector settings need to be passed in differently.
78 web_view->SetInspectorSettings(inspector_settings); 77 web_view->SetInspectorSettings(inspector_settings);
79 } 78 }
OLDNEW
« chrome/browser/extensions/extension_storage_apitest.cc ('K') | « webkit/glue/webpreferences.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine