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

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

Issue 2790943003: Add ability to have active window autohide shelf (Closed)
Patch Set: 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 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:
« 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