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

Unified Diff: ash/wm/window_state.cc

Issue 59043013: Add flag to enable immersive fullscreen for v2 apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: ash/wm/window_state.cc
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc
index 1a06a58da1bb0a0b876bb2c64457d10d234feab1..c7b13caa5842ac6e0602e1355d6c70e882451b10 100644
--- a/ash/wm/window_state.cc
+++ b/ash/wm/window_state.cc
@@ -170,18 +170,20 @@ void WindowState::ToggleMaximized() {
}
void WindowState::ToggleFullscreen() {
- // Window which cannot be maximized should not be fullscreened.
- // It can, however, be restored if it was fullscreened.
bool is_fullscreen = IsFullscreen();
- if (!is_fullscreen && !CanMaximize())
- return;
- if (delegate_ && delegate_->ToggleFullscreen(this))
- return;
if (is_fullscreen) {
- Restore();
+ if (delegate_ && delegate_->ExitFullscreen(this))
+ return;
+ Restore();
} else {
- window_->SetProperty(aura::client::kShowStateKey,
- ui::SHOW_STATE_FULLSCREEN);
+ // Windows which cannot be maximized should not be fullscreened.
+ if (CanMaximize()) {
+ if (delegate_ && delegate_->EnterImmersiveFullscreen(this))
+ return;
+
+ window_->SetProperty(aura::client::kShowStateKey,
+ ui::SHOW_STATE_FULLSCREEN);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698