Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2782223002: Add ability to have active window autohide shelf (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/wm/window_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bc61c13515482543af83dee690225374a3cec07b..426a9b9f183f35731bf45595233b4bc7de640a69 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -26,6 +26,7 @@
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/wm/screen_pinning_controller.h"
+#include "ash/wm/window_state_aura.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/i18n/rtl.h"
@@ -248,9 +249,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.
@@ -260,7 +264,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:
@@ -1038,6 +1046,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:
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/wm/window_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698