diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 01:14:58 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 01:14:58 +0000 |
commit | 2e2a5404a58ae577ebfa65e6f7575eec8cd393cf (patch) | |
tree | 3fc7dfe6b7da820cc05319f17c4316c54151385e | |
parent | 5d56ba000c0f51a91632708a27cb25367120a61d (diff) | |
download | chromium_src-2e2a5404a58ae577ebfa65e6f7575eec8cd393cf.zip chromium_src-2e2a5404a58ae577ebfa65e6f7575eec8cd393cf.tar.gz chromium_src-2e2a5404a58ae577ebfa65e6f7575eec8cd393cf.tar.bz2 |
Adds a command line switch to enable the appcache, and plumb the switch throughto preferences and webcore settings.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/164306
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23135 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_delegate_helper.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 4 | ||||
-rw-r--r-- | webkit/api/public/WebSettings.h | 1 | ||||
-rw-r--r-- | webkit/api/src/WebSettingsImpl.cpp | 5 | ||||
-rw-r--r-- | webkit/api/src/WebSettingsImpl.h | 1 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 2 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 1 |
10 files changed, 21 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index d28d0f5..5146caf 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -176,6 +176,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( command_line.HasSwitch(switches::kEnableRemoteFonts); web_prefs.xss_auditor_enabled = command_line.HasSwitch(switches::kEnableXSSAuditor); + web_prefs.application_cache_enabled = + command_line.HasSwitch(switches::kEnableApplicationCache); // NOTE: We imply local storage enabledness for extensions because the // extensions team is beta testing local storage and we like to live on the diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index b0a59bf..9331f66 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -569,4 +569,7 @@ const wchar_t kGoogleInternalCrashReporting[] = // Enables HTML5 DB support. const wchar_t kEnableDatabases[] = L"enable-databases"; + +// Enable ApplicationCache. Still mostly not there. +const wchar_t kEnableApplicationCache[] = L"enable-application-cache"; } // namespace switches diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 3d47067..d109593 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -223,6 +223,8 @@ extern const wchar_t kDisableCustomJumpList[]; extern const wchar_t kGoogleInternalCrashReporting[]; extern const wchar_t kEnableDatabases[]; + +extern const wchar_t kEnableApplicationCache[]; } // namespace switches #endif // CHROME_COMMON_CHROME_SWITCHES_H_ diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 63d91c0..fefa3ac 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1624,6 +1624,7 @@ struct ParamTraits<WebPreferences> { WriteParam(m, p.xss_auditor_enabled); WriteParam(m, p.local_storage_enabled); WriteParam(m, p.session_storage_enabled); + WriteParam(m, p.application_cache_enabled); } static bool Read(const Message* m, void** iter, param_type* p) { return @@ -1656,7 +1657,8 @@ struct ParamTraits<WebPreferences> { ReadParam(m, iter, &p->remote_fonts_enabled) && ReadParam(m, iter, &p->xss_auditor_enabled) && ReadParam(m, iter, &p->local_storage_enabled) && - ReadParam(m, iter, &p->session_storage_enabled); + ReadParam(m, iter, &p->session_storage_enabled) && + ReadParam(m, iter, &p->application_cache_enabled); } static void Log(const param_type& p, std::wstring* l) { l->append(L"<WebPreferences>"); diff --git a/webkit/api/public/WebSettings.h b/webkit/api/public/WebSettings.h index d0af35e..166b396 100644 --- a/webkit/api/public/WebSettings.h +++ b/webkit/api/public/WebSettings.h @@ -78,6 +78,7 @@ namespace WebKit { virtual void setDatabasesEnabled(bool) = 0; virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() = 0; + virtual void setOfflineWebApplicationCacheEnabled(bool) = 0; protected: ~WebSettings() { } diff --git a/webkit/api/src/WebSettingsImpl.cpp b/webkit/api/src/WebSettingsImpl.cpp index b873aff..948f80c 100644 --- a/webkit/api/src/WebSettingsImpl.cpp +++ b/webkit/api/src/WebSettingsImpl.cpp @@ -230,4 +230,9 @@ void WebSettingsImpl::setTextDirectionSubmenuInclusionBehaviorNeverIncluded() m_settings->setTextDirectionSubmenuInclusionBehavior(WebCore::TextDirectionSubmenuNeverIncluded); } +void WebSettingsImpl::setOfflineWebApplicationCacheEnabled(bool allow) +{ + m_settings->setOfflineWebApplicationCacheEnabled(allow); +} + } // namespace WebKit diff --git a/webkit/api/src/WebSettingsImpl.h b/webkit/api/src/WebSettingsImpl.h index 79882d2..7d15ac7 100644 --- a/webkit/api/src/WebSettingsImpl.h +++ b/webkit/api/src/WebSettingsImpl.h @@ -80,6 +80,7 @@ namespace WebKit { virtual void setDatabasesEnabled(bool); virtual void setAllowUniversalAccessFromFileURLs(bool); virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); + virtual void setOfflineWebApplicationCacheEnabled(bool); private: WebCore::Settings* m_settings; diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index dd0581e..cf71900 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -44,6 +44,7 @@ struct WebPreferences { bool xss_auditor_enabled; bool local_storage_enabled; bool session_storage_enabled; + bool application_cache_enabled; // TODO(tc): User style sheets will not work in chrome because it tries to // load the style sheet using a request without a frame. @@ -83,6 +84,7 @@ struct WebPreferences { xss_auditor_enabled(false), local_storage_enabled(false), session_storage_enabled(false), + application_cache_enabled(false), user_style_sheet_enabled(false) { } }; diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 16bc819..2a646e8 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1411,6 +1411,7 @@ void WebViewImpl::SetPreferences(const WebPreferences& preferences) { settings->setXSSAuditorEnabled(preferences.xss_auditor_enabled); settings->setLocalStorageEnabled(preferences.local_storage_enabled); settings->setSessionStorageEnabled(preferences.session_storage_enabled); + settings->setOfflineWebApplicationCacheEnabled(preferences.application_cache_enabled); // This setting affects the behavior of links in an editable region: // clicking the link should select it rather than navigate to it. diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index df1f953..9cd407c 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -425,6 +425,7 @@ void TestShell::ResetWebPreferences() { web_prefs_->remote_fonts_enabled = true; web_prefs_->local_storage_enabled = true; web_prefs_->session_storage_enabled = true; + web_prefs_->application_cache_enabled = true; } } |