summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 17:14:02 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 17:14:02 +0000
commit686c915914c687703d035d839738e978c7c773d3 (patch)
tree5ef9d6cf11fa171d93b6311030b6d71d87d94b86
parentd54fe1374fa4c1755887efa276f68f64042cc40c (diff)
downloadchromium_src-686c915914c687703d035d839738e978c7c773d3.zip
chromium_src-686c915914c687703d035d839738e978c7c773d3.tar.gz
chromium_src-686c915914c687703d035d839738e978c7c773d3.tar.bz2
Enable Pointer Lock by default, change about:flags option to multi-select.
BUG=72754 Review URL: https://chromiumcodereview.appspot.com/10661030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143931 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd2
-rw-r--r--chrome/browser/about_flags.cc10
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/public/common/content_switches.cc3
-rw-r--r--content/public/common/content_switches.h1
-rw-r--r--content/renderer/render_thread_impl.cc2
6 files changed, 16 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 1a17af3..9c689fb 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5616,7 +5616,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
Disable throttling the rate of window resize. We throttle the resize for less perceived latency.
</message>
<message name="IDS_FLAGS_ENABLE_POINTER_LOCK_NAME" desc="Title for the flag to enable the pointer lock feature.">
- Enable Pointer Lock
+ Pointer Lock
</message>
<message name="IDS_FLAGS_ENABLE_POINTER_LOCK_DESCRIPTION" desc="Description for the flag to enable the mouse lock feature.">
Web pages may capture the mouse pointer and remove it from the user's control. The mouse movement data is directed solely to the web application. Users can escape by pressing the 'Esc' key.
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index c17ea11..923008a 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -131,6 +131,14 @@ const Experiment::Choice kTouchOptimizedUIChoices[] = {
switches::kTouchOptimizedUIDisabled }
};
+const Experiment::Choice kPointerLockUIChoices[] = {
+ { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
+ { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
+ switches::kEnablePointerLock, ""},
+ { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
+ switches::kDisablePointerLock, ""}
+};
+
// RECORDING USER METRICS FOR FLAGS:
// -----------------------------------------------------------------------------
@@ -525,7 +533,7 @@ const Experiment kExperiments[] = {
IDS_FLAGS_ENABLE_POINTER_LOCK_NAME,
IDS_FLAGS_ENABLE_POINTER_LOCK_DESCRIPTION,
kOsAll,
- SINGLE_VALUE_TYPE(switches::kEnablePointerLock)
+ MULTI_VALUE_TYPE(kPointerLockUIChoices)
},
#if defined(USE_ASH)
{
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 2d0a09f..3a5907b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -671,6 +671,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableJavaScriptI18NAPI,
switches::kDisableLocalStorage,
switches::kDisableLogging,
+ switches::kDisablePointerLock,
switches::kDisableSeccompFilterSandbox,
switches::kDisableSeccompSandbox,
switches::kDisableSessionStorage,
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 110686e..cba155d 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -164,6 +164,9 @@ const char kDisableLogging[] = "disable-logging";
// Prevent plugins from running.
const char kDisablePlugins[] = "disable-plugins";
+// Disable the JavaScript Pointer Lock API.
+const char kDisablePointerLock[] = "disable-pointer-lock";
+
// Disable pop-up blocking.
const char kDisablePopupBlocking[] = "disable-popup-blocking";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 6e651b4..96b216d 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -63,6 +63,7 @@ CONTENT_EXPORT extern const char kDisableLocalStorage[];
CONTENT_EXPORT extern const char kDisableLogging[];
CONTENT_EXPORT extern const char kDisableSmoothScrolling[];
CONTENT_EXPORT extern const char kDisablePlugins[];
+extern const char kDisablePointerLock[];
CONTENT_EXPORT extern const char kDisablePopupBlocking[];
extern const char kDisableRemoteFonts[];
extern const char kDisableRendererAccessibility[];
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 915514d..ce0c411 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -562,7 +562,7 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
!command_line.HasSwitch(switches::kDisableFullScreen));
WebKit::WebRuntimeFeatures::enablePointerLock(
- command_line.HasSwitch(switches::kEnablePointerLock));
+ !command_line.HasSwitch(switches::kDisablePointerLock));
WebKit::WebRuntimeFeatures::enableVideoTrack(
command_line.HasSwitch(switches::kEnableVideoTrack));