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

Unified Diff: chrome/browser/ui/exclusive_access/fullscreen_controller.cc

Issue 1488653002: Fix scroll restoration when exiting fullscreen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from scheib@ Created 4 years, 11 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
Index: chrome/browser/ui/exclusive_access/fullscreen_controller.cc
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
index 9f18156b6f09cca7b8ef2857e9901875a6db8cd8..c7f7f9a54678bc19de4b158f4f59b3e37a41352a 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
@@ -273,7 +273,8 @@ void FullscreenController::OnTabDetachedFromView(WebContents* old_contents) {
void FullscreenController::OnTabClosing(WebContents* web_contents) {
if (IsFullscreenForCapturedTab(web_contents)) {
- web_contents->ExitFullscreen();
+ bool will_cause_resize = IsFullscreenCausedByTab();
+ web_contents->ExitFullscreen(will_cause_resize);
} else {
ExclusiveAccessControllerBase::OnTabClosing(web_contents);
}
@@ -300,7 +301,8 @@ bool FullscreenController::HandleUserPressedEscape() {
WebContents* const active_web_contents =
exclusive_access_manager()->context()->GetActiveWebContents();
if (IsFullscreenForCapturedTab(active_web_contents)) {
- active_web_contents->ExitFullscreen();
+ bool will_cause_resize = IsFullscreenCausedByTab();
+ active_web_contents->ExitFullscreen(will_cause_resize);
return true;
} else if (IsWindowFullscreenForTabOrPending()) {
ExitExclusiveAccessIfNecessary();
@@ -409,9 +411,10 @@ void FullscreenController::NotifyTabExclusiveAccessLost() {
WebContents* web_contents = exclusive_access_tab();
SetTabWithExclusiveAccess(nullptr);
fullscreened_origin_ = GURL();
+ bool will_cause_resize = IsFullscreenCausedByTab();
state_prior_to_tab_fullscreen_ = STATE_INVALID;
tab_fullscreen_accepted_ = false;
- web_contents->ExitFullscreen();
+ web_contents->ExitFullscreen(will_cause_resize);
exclusive_access_manager()->UpdateExclusiveAccessExitBubbleContent();
}
}

Powered by Google App Engine
This is Rietveld 408576698