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" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 436 SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
437 } else if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN && | 437 } else if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN && |
438 auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_NEVER) { | 438 auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_NEVER) { |
439 gesture_drag_status_ = GESTURE_DRAG_NONE; | 439 gesture_drag_status_ = GESTURE_DRAG_NONE; |
440 SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 440 SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
441 } else { | 441 } else { |
442 gesture_drag_status_ = GESTURE_DRAG_COMPLETE_IN_PROGRESS; | 442 gesture_drag_status_ = GESTURE_DRAG_COMPLETE_IN_PROGRESS; |
443 UpdateVisibilityState(); | 443 UpdateVisibilityState(); |
444 gesture_drag_status_ = GESTURE_DRAG_NONE; | 444 gesture_drag_status_ = GESTURE_DRAG_NONE; |
445 } | 445 } |
| 446 LayoutShelf(); |
446 } | 447 } |
447 | 448 |
448 void ShelfLayoutManager::CancelGestureDrag() { | 449 void ShelfLayoutManager::CancelGestureDrag() { |
449 gesture_drag_status_ = GESTURE_DRAG_NONE; | 450 gesture_drag_status_ = GESTURE_DRAG_NONE; |
450 ui::ScopedLayerAnimationSettings | 451 ui::ScopedLayerAnimationSettings |
451 launcher_settings(GetLayer(shelf_)->GetAnimator()), | 452 launcher_settings(GetLayer(shelf_)->GetAnimator()), |
452 status_settings(GetLayer(shelf_->status_area_widget())->GetAnimator()); | 453 status_settings(GetLayer(shelf_->status_area_widget())->GetAnimator()); |
453 LayoutShelf(); | 454 LayoutShelf(); |
454 UpdateVisibilityState(); | 455 UpdateVisibilityState(); |
455 UpdateShelfBackground(BackgroundAnimator::CHANGE_ANIMATE); | 456 UpdateShelfBackground(BackgroundAnimator::CHANGE_ANIMATE); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 908 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
908 if (state.visibility_state == SHELF_VISIBLE) | 909 if (state.visibility_state == SHELF_VISIBLE) |
909 return size; | 910 return size; |
910 if (state.visibility_state == SHELF_AUTO_HIDE) | 911 if (state.visibility_state == SHELF_AUTO_HIDE) |
911 return kAutoHideSize; | 912 return kAutoHideSize; |
912 return 0; | 913 return 0; |
913 } | 914 } |
914 | 915 |
915 } // namespace internal | 916 } // namespace internal |
916 } // namespace ash | 917 } // namespace ash |
OLD | NEW |