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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/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" |
11 #include "ash/launcher/launcher.h" | 11 #include "ash/launcher/launcher.h" |
12 #include "ash/launcher/launcher_types.h" | 12 #include "ash/launcher/launcher_types.h" |
13 #include "ash/root_window_controller.h" | 13 #include "ash/root_window_controller.h" |
14 #include "ash/screen_ash.h" | 14 #include "ash/screen_ash.h" |
15 #include "ash/session_state_delegate.h" | 15 #include "ash/session_state_delegate.h" |
16 #include "ash/shelf/shelf_widget.h" | 16 #include "ash/shelf/shelf_widget.h" |
17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
18 #include "ash/shell_window_ids.h" | 18 #include "ash/shell_window_ids.h" |
19 #include "ash/system/status_area_widget.h" | 19 #include "ash/system/status_area_widget.h" |
20 #include "ash/wm/property_util.h" | 20 #include "ash/wm/property_util.h" |
21 #include "ash/wm/window_cycle_controller.h" | 21 #include "ash/wm/window_cycle_controller.h" |
| 22 #include "ash/wm/window_properties.h" |
22 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
23 #include "ash/wm/workspace_controller.h" | 24 #include "ash/wm/workspace_controller.h" |
24 #include "ash/wm/workspace/workspace_animations.h" | 25 #include "ash/wm/workspace/workspace_animations.h" |
25 #include "base/auto_reset.h" | 26 #include "base/auto_reset.h" |
26 #include "base/command_line.h" | 27 #include "base/command_line.h" |
27 #include "base/i18n/rtl.h" | 28 #include "base/i18n/rtl.h" |
28 #include "ui/aura/client/activation_client.h" | 29 #include "ui/aura/client/activation_client.h" |
29 #include "ui/aura/root_window.h" | 30 #include "ui/aura/root_window.h" |
30 #include "ui/base/events/event.h" | 31 #include "ui/base/events/event.h" |
31 #include "ui/base/events/event_handler.h" | 32 #include "ui/base/events/event_handler.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return SHELF_VISIBLE; | 270 return SHELF_VISIBLE; |
270 } | 271 } |
271 | 272 |
272 void ShelfLayoutManager::UpdateVisibilityState() { | 273 void ShelfLayoutManager::UpdateVisibilityState() { |
273 if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked()) { | 274 if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked()) { |
274 SetState(SHELF_VISIBLE); | 275 SetState(SHELF_VISIBLE); |
275 } else if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) { | 276 } else if (gesture_drag_status_ == GESTURE_DRAG_COMPLETE_IN_PROGRESS) { |
276 // TODO(zelidrag): Verify shelf drag animation still shows on the device | 277 // TODO(zelidrag): Verify shelf drag animation still shows on the device |
277 // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN. | 278 // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN. |
278 SetState(CalculateShelfVisibilityWhileDragging()); | 279 SetState(CalculateShelfVisibilityWhileDragging()); |
279 } else if (GetRootWindowController(root_window_)->IsImmersiveMode()) { | |
280 // The user choosing immersive mode indicates he or she wants to maximize | |
281 // screen real-estate for content, so always auto-hide the shelf. | |
282 DCHECK_NE(auto_hide_behavior_, SHELF_AUTO_HIDE_ALWAYS_HIDDEN); | |
283 SetState(SHELF_AUTO_HIDE); | |
284 } else { | 280 } else { |
285 WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); | 281 WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); |
286 switch (window_state) { | 282 switch (window_state) { |
287 case WORKSPACE_WINDOW_STATE_FULL_SCREEN: | 283 case WORKSPACE_WINDOW_STATE_FULL_SCREEN: |
288 SetState(SHELF_HIDDEN); | 284 { |
| 285 aura::Window* fullscreen_window = |
| 286 GetRootWindowController(root_window_)->GetFullscreenWindow(); |
| 287 if (fullscreen_window->GetProperty(kFullscreenUsesMinimalChromeKey)) { |
| 288 DCHECK_NE(auto_hide_behavior_, SHELF_AUTO_HIDE_ALWAYS_HIDDEN); |
| 289 SetState(SHELF_AUTO_HIDE); |
| 290 } else { |
| 291 SetState(SHELF_HIDDEN); |
| 292 } |
289 break; | 293 break; |
290 | 294 } |
291 case WORKSPACE_WINDOW_STATE_MAXIMIZED: | 295 case WORKSPACE_WINDOW_STATE_MAXIMIZED: |
292 SetState(CalculateShelfVisibility()); | 296 SetState(CalculateShelfVisibility()); |
293 break; | 297 break; |
294 | 298 |
295 case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF: | 299 case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF: |
296 case WORKSPACE_WINDOW_STATE_DEFAULT: | 300 case WORKSPACE_WINDOW_STATE_DEFAULT: |
297 SetState(CalculateShelfVisibility()); | 301 SetState(CalculateShelfVisibility()); |
298 SetWindowOverlapsShelf(window_state == | 302 SetWindowOverlapsShelf(window_state == |
299 WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF); | 303 WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF); |
300 break; | 304 break; |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 912 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
909 if (state.visibility_state == SHELF_VISIBLE) | 913 if (state.visibility_state == SHELF_VISIBLE) |
910 return size; | 914 return size; |
911 if (state.visibility_state == SHELF_AUTO_HIDE) | 915 if (state.visibility_state == SHELF_AUTO_HIDE) |
912 return kAutoHideSize; | 916 return kAutoHideSize; |
913 return 0; | 917 return 0; |
914 } | 918 } |
915 | 919 |
916 } // namespace internal | 920 } // namespace internal |
917 } // namespace ash | 921 } // namespace ash |
OLD | NEW |