Commit 98fccbf6 authored by jonross's avatar jonross Committed by Commit bot

Enable ScreenOrientation API by default

Add new flag to disable screen orientation locking. Update ScreenOrientationController to be enabled by default, and to check flag state for disabling.

TEST=Set flag to check feature was disabled.
BUG=396760

Review URL: https://codereview.chromium.org/901963002

Cr-Commit-Position: refs/heads/master@{#314895}
parent 65088185
......@@ -33,6 +33,12 @@ const char kAshDebugShortcuts[] = "ash-debug-shortcuts";
// WorkspaceLayoutManager.
const char kAshDisableLockLayoutManager[] = "ash-disable-lock-layout-manager";
#if defined(OS_CHROMEOS)
// Disable the support for WebContents to lock the screen orientation.
const char kAshDisableScreenOrientationLock[] =
"ash-disable-screen-orientation-lock";
#endif
// Disable the Touch Exploration Mode. Touch Exploration Mode will no longer be
// turned on automatically when spoken feedback is enabled when this flag is
// set.
......
......@@ -22,6 +22,9 @@ ASH_EXPORT extern const char kAshConstrainPointerToRoot[];
ASH_EXPORT extern const char kAshCopyHostBackgroundAtBoot[];
ASH_EXPORT extern const char kAshDebugShortcuts[];
ASH_EXPORT extern const char kAshDisableLockLayoutManager[];
#if defined(OS_CHROMEOS)
ASH_EXPORT extern const char kAshDisableScreenOrientationLock[];
#endif
ASH_EXPORT extern const char kAshDisableTouchExplorationMode[];
#if defined(OS_CHROMEOS)
ASH_EXPORT extern const char kAshEnableFullscreenAppList[];
......
......@@ -183,8 +183,8 @@ bool ScreenOrientationController::ScreenOrientationProviderSupported() {
return Shell::GetInstance()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled() &&
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshEnableTouchViewTesting);
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshDisableScreenOrientationLock);
}
void ScreenOrientationController::Unlock(content::WebContents* web_contents) {
......
......@@ -6064,6 +6064,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
Disable user gesture requirement for playing media elements. Activating this will allow autoplay to work.
</message>
<if expr="use_ash">
<message name="IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME" desc="Title for the flag which can be used to disable support for javascript locking rotation.">
Disable Screen Orientation locking.
</message>
<message name="IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION" desc="Description for the flag which can be used to disable support for javascript locking rotation">
Disables the ability for javascript to lock the screen orienation.
</message>
<message name="IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME" desc="Title for the flag which can be used to test the TouchView maximizing mode.">
Enable TouchView maximizing UI for testing
</message>
......
......@@ -932,6 +932,13 @@ const Experiment kExperiments[] = {
kOsCrOS,
SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
},
{
"ash-disable-screen-orientation-lock",
IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
kOsCrOS,
SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
},
#endif // defined(OS_CHROMEOS)
{ "disable-accelerated-video-decode",
IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
......
......@@ -50992,6 +50992,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="360599302" label="enable-gpu-rasterization"/>
<int value="365467768" label="prefetch-search-results"/>
<int value="370486304" label="enable-origin-chip-on-srp"/>
<int value="400322063" label="ash-disable-screen-orientation-lock"/>
<int value="401983950" label="enable-spdy4"/>
<int value="402143634" label="enable-search-button-in-omnibox-always"/>
<int value="413081240" label="enable-new-md-input-view"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment