Index: ash/wm/window_state.cc |
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc |
index 2afba08d68f104fde02c523099d592422e59e859..0b4e6239aa808bb0a32aa605fd13a9ff684f0b6c 100644 |
--- a/ash/wm/window_state.cc |
+++ b/ash/wm/window_state.cc |
@@ -28,6 +28,7 @@ bool WindowState::IsMaximizedOrFullscreenState(ui::WindowShowState show_state) { |
WindowState::WindowState(aura::Window* window) |
: window_(window), |
+ fullscreen_type_(FULLSCREEN_TYPE_DEFAULT), |
tracked_by_workspace_(true), |
window_position_managed_(false), |
bounds_changed_by_user_(false), |
@@ -60,6 +61,13 @@ bool WindowState::IsFullscreen() const { |
return GetShowState() == ui::SHOW_STATE_FULLSCREEN; |
} |
+bool WindowState::IsImmersiveFullscreen() const { |
+ if (!IsFullscreen()) |
+ return false; |
+ return fullscreen_type_ == FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME || |
+ fullscreen_type_ == FULLSCREEN_TYPE_IMMERSIVE_NO_CHROME; |
+} |
+ |
bool WindowState::IsMaximizedOrFullscreen() const { |
return IsMaximizedOrFullscreenState(GetShowState()); |
} |
@@ -191,6 +199,15 @@ void WindowState::ClearRestoreBounds() { |
window_->ClearProperty(aura::client::kRestoreBoundsKey); |
} |
+void WindowState::SetFullscreenType(FullscreenType type) { |
+ if (!IsFullscreen() || fullscreen_type_ == type) |
+ return; |
+ FullscreenType old = fullscreen_type_; |
+ fullscreen_type_ = type; |
+ FOR_EACH_OBSERVER(WindowStateObserver, observer_list_, |
+ OnWindowFullscreenTypeChanged(this, old)); |
+} |
+ |
void WindowState::SetPreAutoManageWindowBounds( |
const gfx::Rect& bounds) { |
pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds)); |
@@ -219,6 +236,11 @@ void WindowState::OnWindowPropertyChanged(aura::Window* window, |
DCHECK_EQ(window, window_); |
if (key == aura::client::kShowStateKey) { |
window_show_type_ = ToWindowShowType(GetShowState()); |
+ if (window_show_type_ != ash::wm::SHOW_TYPE_FULLSCREEN && |
+ window_show_type_ != ash::wm::SHOW_TYPE_MINIMIZED) { |
+ fullscreen_type_ = FULLSCREEN_TYPE_DEFAULT; |
+ } |
+ |
ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); |
// TODO(oshima): Notify only when the state has changed. |
// Doing so break a few tests now. |