Chromium Code Reviews| 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 f145a7ec82f3f9eb14bb1c981143f7e798aa261a..82ff70d55534e29d03ffe9f8b87936a292e09859 100644 |
| --- a/ash/common/shelf/shelf_layout_manager.cc |
| +++ b/ash/common/shelf/shelf_layout_manager.cc |
| @@ -25,6 +25,7 @@ |
| #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" |
| @@ -247,9 +248,16 @@ void ShelfLayoutManager::UpdateVisibilityState() { |
| // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN. |
| wm::WorkspaceWindowState window_state( |
| shelf_window->GetRootWindowController()->GetWorkspaceWindowState()); |
| + |
| + // SetState(SHELF_AUTO_HIDE); |
| + // return; |
| + //} |
|
oshima
2017/03/30 19:35:58
clean up?
yorkelee
2017/03/30 19:38:37
Done.
yorkelee
2017/03/30 19:38:37
Done.
|
| + |
| 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. |
| @@ -259,7 +267,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: |
| @@ -1037,6 +1049,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: |