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

Unified Diff: ash/wm/shelf_layout_manager.cc

Issue 12077055: Made launcher hidden when kicking off chrome in app mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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/wm/shelf_layout_manager.h ('k') | chrome/browser/app_mode/app_mode_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/shelf_layout_manager.cc
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index 52f6b03fcedac4705922301067e4a51044a7d48d..ec62865651e0901c675e8019789fbd11abe5f127 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -247,15 +247,42 @@ void ShelfLayoutManager::LayoutShelf() {
UpdateHitTestBounds();
}
+ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() {
+ switch(auto_hide_behavior_) {
+ case SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS:
+ return SHELF_AUTO_HIDE;
+ case SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
+ return SHELF_VISIBLE;
+ case SHELF_AUTO_HIDE_ALWAYS_HIDDEN:
+ return SHELF_HIDDEN;
+ }
+ return SHELF_VISIBLE;
+}
+
+ShelfVisibilityState
+ShelfLayoutManager::CalculateShelfVisibilityWhileDragging() {
+ switch(auto_hide_behavior_) {
+ case SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS:
+ case SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
+ return SHELF_AUTO_HIDE;
+ case SHELF_AUTO_HIDE_ALWAYS_HIDDEN:
+ return SHELF_HIDDEN;
+ }
+ return SHELF_VISIBLE;
+}
+
void ShelfLayoutManager::UpdateVisibilityState() {
ShellDelegate* delegate = Shell::GetInstance()->delegate();
if (delegate && delegate->IsScreenLocked()) {
SetState(SHELF_VISIBLE);
} else if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) {
- SetState(SHELF_AUTO_HIDE);
+ // TODO(zelidrag): Verify shelf drag animation still shows on the device
+ // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN.
+ SetState(CalculateShelfVisibilityWhileDragging());
} else if (GetRootWindowController(root_window_)->IsImmersiveMode()) {
// The user choosing immersive mode indicates he or she wants to maximize
// screen real-estate for content, so always auto-hide the shelf.
+ DCHECK_NE(auto_hide_behavior_, SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
SetState(SHELF_AUTO_HIDE);
} else {
WorkspaceWindowState window_state(workspace_controller_->GetWindowState());
@@ -265,14 +292,12 @@ void ShelfLayoutManager::UpdateVisibilityState() {
break;
case WORKSPACE_WINDOW_STATE_MAXIMIZED:
- SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
- SHELF_AUTO_HIDE : SHELF_VISIBLE);
+ SetState(CalculateShelfVisibility());
break;
case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF:
case WORKSPACE_WINDOW_STATE_DEFAULT:
- SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
- SHELF_AUTO_HIDE : SHELF_VISIBLE);
+ SetState(CalculateShelfVisibility());
SetWindowOverlapsShelf(window_state ==
WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF);
break;
« no previous file with comments | « ash/wm/shelf_layout_manager.h ('k') | chrome/browser/app_mode/app_mode_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698