Index: trunk/src/ash/shelf/shelf_layout_manager.cc |
=================================================================== |
--- trunk/src/ash/shelf/shelf_layout_manager.cc (revision 213311) |
+++ trunk/src/ash/shelf/shelf_layout_manager.cc (working copy) |
@@ -211,6 +211,8 @@ |
auto_hide_behavior_ = behavior; |
UpdateVisibilityState(); |
FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
+ OnAutoHideStateChanged(state_.auto_hide_state)); |
+ FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
OnAutoHideBehaviorChanged(root_window_, |
auto_hide_behavior_)); |
} |
@@ -331,12 +333,17 @@ |
if (auto_hide_state == SHELF_AUTO_HIDE_HIDDEN) { |
// Hides happen immediately. |
SetState(state_.visibility_state); |
+ FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
+ OnAutoHideStateChanged(auto_hide_state)); |
} else { |
auto_hide_timer_.Stop(); |
auto_hide_timer_.Start( |
FROM_HERE, |
base::TimeDelta::FromMilliseconds(kAutoHideDelayMS), |
this, &ShelfLayoutManager::UpdateAutoHideStateNow); |
+ FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
+ OnAutoHideStateChanged( |
+ CalculateAutoHideState(state_.visibility_state))); |
} |
} else { |
auto_hide_timer_.Stop(); |
@@ -651,16 +658,6 @@ |
UpdateHitTestBounds(); |
if (!delay_shelf_update) |
UpdateShelfBackground(change_type); |
- |
- // OnAutoHideStateChanged Should be emitted when: |
- // - firstly state changed to auto-hide from other state |
- // - or, auto_hide_state has changed |
- if ((old_state.visibility_state != state_.visibility_state && |
- state_.visibility_state == SHELF_AUTO_HIDE) || |
- old_state.auto_hide_state != state_.auto_hide_state) { |
- FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
- OnAutoHideStateChanged(state_.auto_hide_state)); |
- } |
} |
void ShelfLayoutManager::StopAnimating() { |