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); |
+ } |
} |
} |