Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: trunk/src/ash/shelf/shelf_layout_manager.cc

Issue 19974006: Revert 213298 "Moves calling OnAutoHideState to when exactly the..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698