diff options
author | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 17:58:25 +0000 |
---|---|---|
committer | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 17:58:25 +0000 |
commit | 3618b6a1c9d8b9925af4988587b2c3e77055ae39 (patch) | |
tree | 7eef0e6742bcfaa15f64627664b3cca0bc86135d | |
parent | d424035d8ab786a0f3671baeda7a362811f8d441 (diff) | |
download | chromium_src-3618b6a1c9d8b9925af4988587b2c3e77055ae39.zip chromium_src-3618b6a1c9d8b9925af4988587b2c3e77055ae39.tar.gz chromium_src-3618b6a1c9d8b9925af4988587b2c3e77055ae39.tar.bz2 |
Add command line flag and associated prefs to allow run-time enable of geolocaiton features.
Once this is landed we can enable GEOLOCATION in WebKit at build time, allowing proper tests
to be written that utilize this flag.
BUG=29182
TEST=Manually enabled GEOLOCATION in WebKit and passed the command line flag.
Review URL: http://codereview.chromium.org/460020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34257 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 | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 4 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 5 |
6 files changed, 17 insertions, 2 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 85585a7..6ed9f3b 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -187,6 +187,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( command_line.HasSwitch(switches::kEnableExperimentalWebGL); web_prefs.site_specific_quirks_enabled = !command_line.HasSwitch(switches::kDisableSiteSpecificQuirks); + web_prefs.geolocation_enabled = + command_line.HasSwitch(switches::kEnableGeolocation); } web_prefs.uses_universal_detector = diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index f64b451..a1a15b3 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -201,6 +201,9 @@ const char kEnableFastback[] = "enable-fastback"; // testing, for example page cycler and layout tests. See bug 1157243. const char kEnableFileCookies[] = "enable-file-cookies"; +// Enable Geolocation support. +const char kEnableGeolocation[] = "enable-geolocation"; + // Disable LocalStorage. const char kDisableLocalStorage[] = "disable-local-storage"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 9698cdf..f0d588d 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -73,6 +73,7 @@ extern const char kEnableExtensionTimelineApi[]; extern const char kEnableExtensionToolstrips[]; extern const char kEnableFastback[]; extern const char kEnableFileCookies[]; +extern const char kEnableGeolocation[]; extern const char kDisableLocalStorage[]; extern const char kEnableLogging[]; extern const char kEnableMonitorProfile[]; diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index e91a2fe..fa714cc 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1635,6 +1635,7 @@ struct ParamTraits<WebPreferences> { WriteParam(m, p.user_style_sheet_location); WriteParam(m, p.allow_universal_access_from_file_urls); WriteParam(m, p.experimental_webgl_enabled); + WriteParam(m, p.geolocation_enabled); } static bool Read(const Message* m, void** iter, param_type* p) { return @@ -1673,7 +1674,8 @@ struct ParamTraits<WebPreferences> { ReadParam(m, iter, &p->user_style_sheet_enabled) && ReadParam(m, iter, &p->user_style_sheet_location) && ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && - ReadParam(m, iter, &p->experimental_webgl_enabled); + ReadParam(m, iter, &p->experimental_webgl_enabled) && + ReadParam(m, iter, &p->geolocation_enabled); } static void Log(const param_type& p, std::wstring* l) { l->append(L"<WebPreferences>"); diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index 9c5780e..2dcdc80 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -84,6 +84,10 @@ void WebPreferences::Apply(WebView* web_view) const { // and support is compiled in. settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); + // Enable geolocation support if requested on command line and support is + // compiled in. + settings->setGeolocationEnabled(geolocation_enabled); + // Web inspector settings need to be passed in differently. web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings)); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index fc4775d..58daa58 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -61,6 +61,8 @@ struct WebPreferences { bool experimental_webgl_enabled; + bool geolocation_enabled; + // We try to keep the default values the same as the default values in // chrome, except for the cases where it would require lots of extra work for // the embedder to use the same default value. @@ -98,7 +100,8 @@ struct WebPreferences { tabs_to_links(true), user_style_sheet_enabled(false), allow_universal_access_from_file_urls(false), - experimental_webgl_enabled(false) { + experimental_webgl_enabled(false), + geolocation_enabled(false) { } void Apply(WebKit::WebView* web_view) const; |