Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index e270547ced2087880f92e1c0f76aa52d94efcb00..566db942d273abe3b4fd4804bdc7a19885bc24bc 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -26,7 +26,6 @@ |
#include "ash/wm/lock_state_controller.h" |
#include "ash/wm/mru_window_tracker.h" |
#include "ash/wm/window_animations.h" |
-#include "ash/wm/window_properties.h" |
#include "ash/wm/window_state.h" |
#include "ash/wm/window_util.h" |
#include "ash/wm/workspace_controller.h" |
@@ -321,10 +320,12 @@ void ShelfLayoutManager::UpdateVisibilityState() { |
WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); |
switch (window_state) { |
case WORKSPACE_WINDOW_STATE_FULL_SCREEN: |
- if (FullscreenWithMinimalChrome()) { |
- SetState(SHELF_AUTO_HIDE); |
- } else { |
+ if (FullscreenWithHiddenShelf()) { |
SetState(SHELF_HIDDEN); |
+ } else { |
+ // The shelf is sometimes not hidden when in immersive fullscreen. |
+ // Force the shelf to be auto hidden in this case. |
+ SetState(SHELF_AUTO_HIDE); |
} |
break; |
case WORKSPACE_WINDOW_STATE_MAXIMIZED: |
@@ -469,10 +470,10 @@ void ShelfLayoutManager::CompleteGestureDrag(const ui::GestureEvent& gesture) { |
gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN ? |
SHELF_AUTO_HIDE_BEHAVIOR_NEVER : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
- // In fullscreen with minimal chrome, the auto hide behavior affects neither |
- // the visibility state nor the auto hide state. Set |gesture_drag_status_| |
- // to GESTURE_DRAG_COMPLETE_IN_PROGRESS to set the auto hide state to |
- // |gesture_drag_auto_hide_state_|. |
+ // When in fullscreen and the shelf is forced to be auto hidden, the auto hide |
+ // behavior affects neither the visibility state nor the auto hide state. Set |
+ // |gesture_drag_status_| to GESTURE_DRAG_COMPLETE_IN_PROGRESS to set the auto |
+ // hide state to |gesture_drag_auto_hide_state_|. |
gesture_drag_status_ = GESTURE_DRAG_COMPLETE_IN_PROGRESS; |
if (auto_hide_behavior_ != new_auto_hide_behavior) |
SetAutoHideBehavior(new_auto_hide_behavior); |
@@ -537,16 +538,14 @@ bool ShelfLayoutManager::IsHorizontalAlignment() const { |
GetAlignment() == SHELF_ALIGNMENT_TOP; |
} |
-bool ShelfLayoutManager::FullscreenWithMinimalChrome() const { |
+bool ShelfLayoutManager::FullscreenWithHiddenShelf() const { |
RootWindowController* controller = GetRootWindowController(root_window_); |
if (!controller) |
return false; |
const aura::Window* window = controller->GetTopmostFullscreenWindow(); |
if (!window) |
return false; |
- if (!window->GetProperty(kFullscreenUsesMinimalChromeKey)) |
- return false; |
- return true; |
+ return wm::GetWindowState(window)->hide_shelf_when_fullscreen(); |
} |
// static |