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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 32943006: [Refactor] Replace kFullscreenUsesMinimalChromeKey with WindowState::hide_shelf_when_fullscreen() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 2 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/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index e270547ced2087880f92e1c0f76aa52d94efcb00..566db942d273abe3b4fd4804bdc7a19885bc24bc 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -26,7 +26,6 @@
#include "ash/wm/lock_state_controller.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/window_animations.h"
-#include "ash/wm/window_properties.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller.h"
@@ -321,10 +320,12 @@ void ShelfLayoutManager::UpdateVisibilityState() {
WorkspaceWindowState window_state(workspace_controller_->GetWindowState());
switch (window_state) {
case WORKSPACE_WINDOW_STATE_FULL_SCREEN:
- if (FullscreenWithMinimalChrome()) {
- SetState(SHELF_AUTO_HIDE);
- } else {
+ if (FullscreenWithHiddenShelf()) {
SetState(SHELF_HIDDEN);
+ } else {
+ // The shelf is sometimes not hidden when in immersive fullscreen.
+ // Force the shelf to be auto hidden in this case.
+ SetState(SHELF_AUTO_HIDE);
}
break;
case WORKSPACE_WINDOW_STATE_MAXIMIZED:
@@ -469,10 +470,10 @@ void ShelfLayoutManager::CompleteGestureDrag(const ui::GestureEvent& gesture) {
gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN ?
SHELF_AUTO_HIDE_BEHAVIOR_NEVER : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
- // In fullscreen with minimal chrome, the auto hide behavior affects neither
- // the visibility state nor the auto hide state. Set |gesture_drag_status_|
- // to GESTURE_DRAG_COMPLETE_IN_PROGRESS to set the auto hide state to
- // |gesture_drag_auto_hide_state_|.
+ // When in fullscreen and the shelf is forced to be auto hidden, the auto hide
+ // behavior affects neither the visibility state nor the auto hide state. Set
+ // |gesture_drag_status_| to GESTURE_DRAG_COMPLETE_IN_PROGRESS to set the auto
+ // hide state to |gesture_drag_auto_hide_state_|.
gesture_drag_status_ = GESTURE_DRAG_COMPLETE_IN_PROGRESS;
if (auto_hide_behavior_ != new_auto_hide_behavior)
SetAutoHideBehavior(new_auto_hide_behavior);
@@ -537,16 +538,14 @@ bool ShelfLayoutManager::IsHorizontalAlignment() const {
GetAlignment() == SHELF_ALIGNMENT_TOP;
}
-bool ShelfLayoutManager::FullscreenWithMinimalChrome() const {
+bool ShelfLayoutManager::FullscreenWithHiddenShelf() const {
RootWindowController* controller = GetRootWindowController(root_window_);
if (!controller)
return false;
const aura::Window* window = controller->GetTopmostFullscreenWindow();
if (!window)
return false;
- if (!window->GetProperty(kFullscreenUsesMinimalChromeKey))
- return false;
- return true;
+ return wm::GetWindowState(window)->hide_shelf_when_fullscreen();
}
// static
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698