Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(996)

Unified Diff: content/browser/screen_orientation/screen_orientation_provider_android.cc

Issue 409143002: [screen-orientation] Don't always unlock when fullscreen state is left. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@start_stop_listening
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698