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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 14740012: Enable shelf gestures in immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed method name as requested and removed code duplication Created 7 years, 7 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/wm/gestures/shelf_gesture_handler.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 0bcbf0a752423279f3a7340eb0257939b8f205bb..cf3e9b3af311d655e13463e352ec482d084d9474 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -294,21 +294,15 @@ void ShelfLayoutManager::UpdateVisibilityState() {
WorkspaceWindowState window_state(workspace_controller_->GetWindowState());
switch (window_state) {
case WORKSPACE_WINDOW_STATE_FULL_SCREEN:
- {
- aura::Window* fullscreen_window =
- GetRootWindowController(root_window_)->GetFullscreenWindow();
- if (fullscreen_window->GetProperty(kFullscreenUsesMinimalChromeKey)) {
- DCHECK_NE(auto_hide_behavior_, SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ if (FullscreenWithMinimalChrome()) {
SetState(SHELF_AUTO_HIDE);
} else {
SetState(SHELF_HIDDEN);
}
break;
- }
case WORKSPACE_WINDOW_STATE_MAXIMIZED:
SetState(CalculateShelfVisibility());
break;
-
case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF:
case WORKSPACE_WINDOW_STATE_DEFAULT:
SetState(CalculateShelfVisibility());
@@ -438,17 +432,21 @@ void ShelfLayoutManager::CompleteGestureDrag(const ui::GestureEvent& gesture) {
CancelGestureDrag();
return;
}
-
+ if (shelf_) {
+ shelf_->Deactivate();
+ shelf_->status_area_widget()->Deactivate();
+ }
gesture_drag_auto_hide_state_ =
gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN ?
SHELF_AUTO_HIDE_HIDDEN : SHELF_AUTO_HIDE_SHOWN;
- if (shelf_)
- shelf_->Deactivate();
- shelf_->status_area_widget()->Deactivate();
if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_HIDDEN &&
auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) {
gesture_drag_status_ = GESTURE_DRAG_NONE;
- SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ if (!FullscreenWithMinimalChrome()) {
+ SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ } else {
+ UpdateVisibilityState();
+ }
} else if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN &&
auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_NEVER) {
gesture_drag_status_ = GESTURE_DRAG_NONE;
@@ -517,6 +515,18 @@ bool ShelfLayoutManager::IsHorizontalAlignment() const {
alignment_ == SHELF_ALIGNMENT_TOP;
}
+bool ShelfLayoutManager::FullscreenWithMinimalChrome() const {
+ RootWindowController* controller = GetRootWindowController(root_window_);
+ if (!controller)
+ return false;
+ aura::Window* window = controller->GetFullscreenWindow();
+ if (!window)
+ return false;
+ if (!window->GetProperty(kFullscreenUsesMinimalChromeKey))
+ return false;
+ return true;
+}
+
// static
ShelfLayoutManager* ShelfLayoutManager::ForLauncher(aura::Window* window) {
ShelfWidget* shelf = RootWindowController::ForLauncher(window)->shelf();
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/wm/gestures/shelf_gesture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698