| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 root_window_, target_bounds.work_area_insets); | 250 root_window_, target_bounds.work_area_insets); |
| 251 UpdateHitTestBounds(); | 251 UpdateHitTestBounds(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void ShelfLayoutManager::UpdateVisibilityState() { | 254 void ShelfLayoutManager::UpdateVisibilityState() { |
| 255 ShellDelegate* delegate = Shell::GetInstance()->delegate(); | 255 ShellDelegate* delegate = Shell::GetInstance()->delegate(); |
| 256 if (delegate && delegate->IsScreenLocked()) { | 256 if (delegate && delegate->IsScreenLocked()) { |
| 257 SetState(SHELF_VISIBLE); | 257 SetState(SHELF_VISIBLE); |
| 258 } else if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) { | 258 } else if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) { |
| 259 SetState(SHELF_AUTO_HIDE); | 259 SetState(SHELF_AUTO_HIDE); |
| 260 } else if (delegate && delegate->IsImmersiveMode()) { |
| 261 // The user choosing immersive mode indicates he or she wants to maximize |
| 262 // screen real-estate for content, so always auto-hide the shelf. |
| 263 SetState(SHELF_AUTO_HIDE); |
| 260 } else { | 264 } else { |
| 261 WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); | 265 WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); |
| 262 switch (window_state) { | 266 switch (window_state) { |
| 263 case WORKSPACE_WINDOW_STATE_FULL_SCREEN: | 267 case WORKSPACE_WINDOW_STATE_FULL_SCREEN: |
| 264 SetState(SHELF_HIDDEN); | 268 SetState(SHELF_HIDDEN); |
| 265 break; | 269 break; |
| 266 | 270 |
| 267 case WORKSPACE_WINDOW_STATE_MAXIMIZED: | 271 case WORKSPACE_WINDOW_STATE_MAXIMIZED: |
| 268 SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? | 272 SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? |
| 269 SHELF_AUTO_HIDE : SHELF_VISIBLE); | 273 SHELF_AUTO_HIDE : SHELF_VISIBLE); |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 897 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
| 894 if (state.visibility_state == SHELF_VISIBLE) | 898 if (state.visibility_state == SHELF_VISIBLE) |
| 895 return size; | 899 return size; |
| 896 if (state.visibility_state == SHELF_AUTO_HIDE) | 900 if (state.visibility_state == SHELF_AUTO_HIDE) |
| 897 return kAutoHideSize; | 901 return kAutoHideSize; |
| 898 return 0; | 902 return 0; |
| 899 } | 903 } |
| 900 | 904 |
| 901 } // namespace internal | 905 } // namespace internal |
| 902 } // namespace ash | 906 } // namespace ash |
| OLD | NEW |