Commit 79f2f794 authored by mlamouri@chromium.org's avatar mlamouri@chromium.org

[screen-orientation] Don't always unlock when fullscreen state is left.

Sometimes fullscreen wasn't required in order to lock. In such case,
fullscreen being left should have no consequence.

BUG=162827

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284743 0039d316-1c4b-4281-b951-d872f2087c98
parent e5e72cc1
...@@ -121,10 +121,18 @@ void ScreenOrientationProviderAndroid::OnOrientationChange() { ...@@ -121,10 +121,18 @@ void ScreenOrientationProviderAndroid::OnOrientationChange() {
void ScreenOrientationProviderAndroid::DidToggleFullscreenModeForTab( void ScreenOrientationProviderAndroid::DidToggleFullscreenModeForTab(
bool entered_fullscreen) { bool entered_fullscreen) {
if (lock_applied_) { if (!lock_applied_)
DCHECK(!entered_fullscreen); return;
UnlockOrientation();
} // If fullscreen is not required in order to lock orientation, don't unlock
// when fullscreen state changes.
ContentViewCoreImpl* cvc =
ContentViewCoreImpl::FromWebContents(web_contents());
if (cvc && !cvc->IsFullscreenRequiredForOrientationLock())
return;
DCHECK(!entered_fullscreen);
UnlockOrientation();
} }
bool ScreenOrientationProviderAndroid::LockMatchesCurrentOrientation( bool ScreenOrientationProviderAndroid::LockMatchesCurrentOrientation(
......
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