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

Unified Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2414303002: Remove usage of FOR_EACH_OBSERVER macro in ash/common (Closed)
Patch Set: Created 4 years, 2 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 | « ash/common/shelf/shelf_button.cc ('k') | ash/common/shelf/shelf_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_layout_manager.cc
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index 6bec096c7187b0ce9a20f8d4c732ddefc54ee98a..4308b03fc856e4675c862b8eebc4b737adbc1737 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -131,8 +131,8 @@ ShelfLayoutManager::~ShelfLayoutManager() {
if (update_shelf_observer_)
update_shelf_observer_->Detach();
- FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
- WillDeleteShelfLayoutManager());
+ for (auto& observer : observers_)
+ observer.WillDeleteShelfLayoutManager();
WmShell::Get()->RemoveShellObserver(this);
WmShell::Get()->RemoveLockStateObserver(this);
WmShell::Get()->GetSessionStateDelegate()->RemoveSessionStateObserver(this);
@@ -176,8 +176,8 @@ void ShelfLayoutManager::LayoutShelfAndUpdateBounds(bool change_work_area) {
UpdateBoundsAndOpacity(target_bounds, false, change_work_area, NULL);
// Update insets in ShelfWindowTargeter when shelf bounds change.
- FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
- WillChangeVisibilityState(visibility_state()));
+ for (auto& observer : observers_)
+ observer.WillChangeVisibilityState(visibility_state());
}
void ShelfLayoutManager::LayoutShelf() {
@@ -461,8 +461,8 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
if (!force_update && state_.Equals(state))
return; // Nothing changed.
- FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
- WillChangeVisibilityState(visibility_state));
+ for (auto& observer : observers_)
+ observer.WillChangeVisibilityState(visibility_state);
StopAutoHideTimer();
@@ -516,8 +516,8 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
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));
+ for (auto& observer : observers_)
+ observer.OnAutoHideStateChanged(state_.auto_hide_state);
}
}
@@ -790,8 +790,8 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
void ShelfLayoutManager::UpdateShelfBackground(
BackgroundAnimatorChangeType type) {
const ShelfBackgroundType background_type(GetShelfBackgroundType());
- FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
- OnBackgroundUpdated(background_type, type));
+ for (auto& observer : observers_)
+ observer.OnBackgroundUpdated(background_type, type);
}
void ShelfLayoutManager::UpdateAutoHideStateNow() {
« no previous file with comments | « ash/common/shelf/shelf_button.cc ('k') | ash/common/shelf/shelf_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698