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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 2424853003: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/ui (Closed)
Patch Set: explicit types 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
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 8ebceb6bfc69d8656ea477f7a47c8dbe840fa8c2..79811c6f284134c2d46abc2d556cfd69bde739b5 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -601,8 +601,8 @@ TabStrip::TabStrip(TabStripController* controller)
}
TabStrip::~TabStrip() {
- FOR_EACH_OBSERVER(TabStripObserver, observers_,
- TabStripDeleted(this));
+ for (TabStripObserver& observer : observers_)
+ observer.TabStripDeleted(this);
// The animations may reference the tabs. Shut down the animation before we
// delete the tabs.
@@ -700,8 +700,8 @@ void TabStrip::AddTabAt(int model_index,
SwapLayoutIfNecessary();
- FOR_EACH_OBSERVER(TabStripObserver, observers_,
- TabStripAddedTabAt(this, model_index));
+ for (TabStripObserver& observer : observers_)
+ observer.TabStripAddedTabAt(this, model_index);
// Stop dragging when a new tab is added and dragging a window. Doing
// otherwise results in a confusing state if the user attempts to reattach. We
@@ -741,8 +741,8 @@ void TabStrip::MoveTab(int from_model_index,
}
SwapLayoutIfNecessary();
- FOR_EACH_OBSERVER(TabStripObserver, observers_,
- TabStripMovedTab(this, from_model_index, to_model_index));
+ for (TabStripObserver& observer : observers_)
+ observer.TabStripMovedTab(this, from_model_index, to_model_index);
}
void TabStrip::RemoveTabAt(content::WebContents* contents, int model_index) {
@@ -763,8 +763,8 @@ void TabStrip::RemoveTabAt(content::WebContents* contents, int model_index) {
}
SwapLayoutIfNecessary();
- FOR_EACH_OBSERVER(TabStripObserver, observers_,
- TabStripRemovedTabAt(this, model_index));
+ for (TabStripObserver& observer : observers_)
+ observer.TabStripRemovedTabAt(this, model_index);
// Stop dragging when a new tab is removed and dragging a window. Doing
// otherwise results in a confusing state if the user attempts to reattach. We
@@ -2428,8 +2428,10 @@ void TabStrip::GenerateIdealBounds() {
GetLayoutConstant(TABSTRIP_NEW_TAB_BUTTON_OVERLAP));
const int old_max_x = newtab_button_bounds_.right();
newtab_button_bounds_.set_origin(gfx::Point(new_tab_x, 0));
- if (newtab_button_bounds_.right() != old_max_x)
- FOR_EACH_OBSERVER(TabStripObserver, observers_, TabStripMaxXChanged(this));
+ if (newtab_button_bounds_.right() != old_max_x) {
+ for (TabStripObserver& observer : observers_)
+ observer.TabStripMaxXChanged(this);
+ }
}
int TabStrip::GenerateIdealBoundsForPinnedTabs(int* first_non_pinned_index) {
« no previous file with comments | « chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698