| Index: ash/wm/shelf_layout_manager.cc
|
| diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
|
| index 156fad152144a9fa89d585ba5f844738e95b1512..9fe7859be50de087a72d0df11bb9b67517939bd6 100644
|
| --- a/ash/wm/shelf_layout_manager.cc
|
| +++ b/ash/wm/shelf_layout_manager.cc
|
| @@ -145,6 +145,8 @@ void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
|
| return;
|
| auto_hide_behavior_ = behavior;
|
| UpdateVisibilityState();
|
| + FOR_EACH_OBSERVER(Observer, observers_,
|
| + OnAutoHideStateChanged(state_.auto_hide_state));
|
| }
|
|
|
| bool ShelfLayoutManager::IsVisible() const {
|
| @@ -279,6 +281,8 @@ void ShelfLayoutManager::UpdateAutoHideState() {
|
| if (auto_hide_state == AUTO_HIDE_HIDDEN) {
|
| // Hides happen immediately.
|
| SetState(state_.visibility_state);
|
| + FOR_EACH_OBSERVER(Observer, observers_,
|
| + OnAutoHideStateChanged(auto_hide_state));
|
| } else {
|
| auto_hide_timer_.Stop();
|
| auto_hide_timer_.Start(
|
| @@ -296,6 +300,14 @@ void ShelfLayoutManager::SetWindowOverlapsShelf(bool value) {
|
| UpdateShelfBackground(internal::BackgroundAnimator::CHANGE_ANIMATE);
|
| }
|
|
|
| +void ShelfLayoutManager::AddObserver(Observer* observer) {
|
| + observers_.AddObserver(observer);
|
| +}
|
| +
|
| +void ShelfLayoutManager::RemoveObserver(Observer* observer) {
|
| + observers_.RemoveObserver(observer);
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ShelfLayoutManager, aura::LayoutManager implementation:
|
|
|
| @@ -345,6 +357,9 @@ void ShelfLayoutManager::SetState(VisibilityState visibility_state) {
|
| if (state_.Equals(state))
|
| return; // Nothing changed.
|
|
|
| + FOR_EACH_OBSERVER(Observer, observers_,
|
| + WillVisibilityStateChange(visibility_state));
|
| +
|
| if (state.visibility_state == AUTO_HIDE) {
|
| // When state is AUTO_HIDE we need to track when the mouse is over the
|
| // launcher to unhide the shelf. AutoHideEventFilter does that for us.
|
| @@ -507,6 +522,8 @@ bool ShelfLayoutManager::GetLauncherPaintsBackground() const {
|
|
|
| void ShelfLayoutManager::UpdateAutoHideStateNow() {
|
| SetState(state_.visibility_state);
|
| + FOR_EACH_OBSERVER(Observer, observers_, OnAutoHideStateChanged(
|
| + CalculateAutoHideState(state_.visibility_state)));
|
| }
|
|
|
| ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState(
|
|
|