| 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/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 CalculateTargetBounds(state_, &target_bounds); | 561 CalculateTargetBounds(state_, &target_bounds); |
| 562 UpdateBoundsAndOpacity( | 562 UpdateBoundsAndOpacity( |
| 563 target_bounds, true /* animate */, true /* change_work_area */, | 563 target_bounds, true /* animate */, true /* change_work_area */, |
| 564 delay_background_change ? update_shelf_observer_ : NULL); | 564 delay_background_change ? update_shelf_observer_ : NULL); |
| 565 | 565 |
| 566 // The delegate must be notified after |state_| is updated so that it can | 566 // The delegate must be notified after |state_| is updated so that it can |
| 567 // query the new target bounds. | 567 // query the new target bounds. |
| 568 ShelfDelegate* shelf_delegate = WmShell::Get()->shelf_delegate(); | 568 ShelfDelegate* shelf_delegate = WmShell::Get()->shelf_delegate(); |
| 569 DCHECK(shelf_delegate); | 569 DCHECK(shelf_delegate); |
| 570 if (old_state.visibility_state != state_.visibility_state) | 570 if (old_state.visibility_state != state_.visibility_state) |
| 571 shelf_delegate->OnShelfVisibilityStateChanged(shelf_widget_->shelf()); | 571 shelf_delegate->OnShelfVisibilityStateChanged(wm_shelf_); |
| 572 | 572 |
| 573 // OnAutoHideStateChanged Should be emitted when: | 573 // OnAutoHideStateChanged Should be emitted when: |
| 574 // - firstly state changed to auto-hide from other state | 574 // - firstly state changed to auto-hide from other state |
| 575 // - or, auto_hide_state has changed | 575 // - or, auto_hide_state has changed |
| 576 if ((old_state.visibility_state != state_.visibility_state && | 576 if ((old_state.visibility_state != state_.visibility_state && |
| 577 state_.visibility_state == SHELF_AUTO_HIDE) || | 577 state_.visibility_state == SHELF_AUTO_HIDE) || |
| 578 old_state.auto_hide_state != state_.auto_hide_state) { | 578 old_state.auto_hide_state != state_.auto_hide_state) { |
| 579 shelf_delegate->OnShelfAutoHideStateChanged(shelf_widget_->shelf()); | 579 shelf_delegate->OnShelfAutoHideStateChanged(wm_shelf_); |
| 580 FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, | 580 FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
| 581 OnAutoHideStateChanged(state_.auto_hide_state)); | 581 OnAutoHideStateChanged(state_.auto_hide_state)); |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 | 584 |
| 585 void ShelfLayoutManager::UpdateBoundsAndOpacity( | 585 void ShelfLayoutManager::UpdateBoundsAndOpacity( |
| 586 const TargetBounds& target_bounds, | 586 const TargetBounds& target_bounds, |
| 587 bool animate, | 587 bool animate, |
| 588 bool change_work_area, | 588 bool change_work_area, |
| 589 ui::ImplicitAnimationObserver* observer) { | 589 ui::ImplicitAnimationObserver* observer) { |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1178 gesture_drag_status_ = GESTURE_DRAG_NONE; |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 int ShelfLayoutManager::GetShelfInsetsForAutoHide() const { | 1181 int ShelfLayoutManager::GetShelfInsetsForAutoHide() const { |
| 1182 if (invisible_auto_hide_shelf_) | 1182 if (invisible_auto_hide_shelf_) |
| 1183 return 0; | 1183 return 0; |
| 1184 return GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE); | 1184 return GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 } // namespace ash | 1187 } // namespace ash |
| OLD | NEW |