Index: content/browser/screen_orientation/screen_orientation_provider_android.cc |
diff --git a/content/browser/screen_orientation/screen_orientation_provider_android.cc b/content/browser/screen_orientation/screen_orientation_provider_android.cc |
index 234b6e3a2bdd57a85c9c8b207275bd3648c3d763..975e43bb19190ff7c8e47eb5f072e0a7f03a92bc 100644 |
--- a/content/browser/screen_orientation/screen_orientation_provider_android.cc |
+++ b/content/browser/screen_orientation/screen_orientation_provider_android.cc |
@@ -121,10 +121,18 @@ void ScreenOrientationProviderAndroid::OnOrientationChange() { |
void ScreenOrientationProviderAndroid::DidToggleFullscreenModeForTab( |
bool entered_fullscreen) { |
- if (lock_applied_) { |
- DCHECK(!entered_fullscreen); |
- UnlockOrientation(); |
- } |
+ if (!lock_applied_) |
+ return; |
+ |
+ // 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( |