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

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

Issue 2782223002: Add ability to have active window autohide shelf (Closed)
Patch Set: Add ability to have active window autohide shelf 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 | « no previous file | ash/common/wm/window_state.h » ('j') | ash/common/wm/window_state.h » ('J')
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 f145a7ec82f3f9eb14bb1c981143f7e798aa261a..31e600ef7c1ec2b86e5bbca7418a09d3d20b9d3c 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"
@@ -243,6 +244,13 @@ void ShelfLayoutManager::UpdateVisibilityState() {
} else if (WmShell::Get()->IsPinned()) {
SetState(SHELF_HIDDEN);
} else {
+ wm::WindowState* active_window = wm::GetActiveWindowState();
+
+ if (active_window && active_window->hide_shelf_when_active()) {
+ SetState(SHELF_AUTO_HIDE);
+ return;
+ }
oshima 2017/03/30 14:01:27 This should happen only when the WORKSPACE_WINDOW_
yorkelee 2017/03/30 19:34:12 Done.
+
// TODO(zelidrag): Verify shelf drag animation still shows on the device
// when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN.
wm::WorkspaceWindowState window_state(
« no previous file with comments | « no previous file | ash/common/wm/window_state.h » ('j') | ash/common/wm/window_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698