| Index: ash/common/shelf/shelf_layout_manager.cc
|
| diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
|
| index d072f518e9fb3859eabc14e4def8b71a55185d62..4b8eb05bdb97e791ff3480ffe7af1bed206d0d0e 100644
|
| --- a/ash/common/shelf/shelf_layout_manager.cc
|
| +++ b/ash/common/shelf/shelf_layout_manager.cc
|
| @@ -25,6 +25,8 @@
|
| #include "ash/common/wm_window.h"
|
| #include "ash/public/cpp/shell_window_ids.h"
|
| #include "ash/root_window_controller.h"
|
| +#include "ash/shell.h"
|
| +#include "ash/wm/window_state_aura.h"
|
| #include "base/auto_reset.h"
|
| #include "base/command_line.h"
|
| #include "base/i18n/rtl.h"
|
| @@ -246,9 +248,12 @@ void ShelfLayoutManager::UpdateVisibilityState() {
|
| // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN.
|
| wm::WorkspaceWindowState window_state(
|
| shelf_window->GetRootWindowController()->GetWorkspaceWindowState());
|
| +
|
| switch (window_state) {
|
| case wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN: {
|
| - if (IsShelfHiddenForFullscreen()) {
|
| + if (IsShelfAutoHideForFullscreenMaximized()) {
|
| + SetState(SHELF_AUTO_HIDE);
|
| + } else if (IsShelfHiddenForFullscreen()) {
|
| SetState(SHELF_HIDDEN);
|
| } else {
|
| // The shelf is sometimes not hidden when in immersive fullscreen.
|
| @@ -258,7 +263,11 @@ void ShelfLayoutManager::UpdateVisibilityState() {
|
| break;
|
| }
|
| case wm::WORKSPACE_WINDOW_STATE_MAXIMIZED:
|
| - SetState(CalculateShelfVisibility());
|
| + if (IsShelfAutoHideForFullscreenMaximized()) {
|
| + SetState(SHELF_AUTO_HIDE);
|
| + } else {
|
| + SetState(CalculateShelfVisibility());
|
| + }
|
| break;
|
|
|
| case wm::WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF:
|
| @@ -1047,6 +1056,12 @@ bool ShelfLayoutManager::IsShelfHiddenForFullscreen() const {
|
| fullscreen_window->GetWindowState()->hide_shelf_when_fullscreen();
|
| }
|
|
|
| +bool ShelfLayoutManager::IsShelfAutoHideForFullscreenMaximized() const {
|
| + wm::WindowState* active_window = wm::GetActiveWindowState();
|
| + return active_window &&
|
| + active_window->autohide_shelf_when_maximized_or_fullscreen();
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ShelfLayoutManager, Gesture functions:
|
|
|
|
|