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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 988633002: [CLEANUP] Rename some methods of ExtensionToolbarModel to be OnFoo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 21451194f6f7fe83c88cd2b38252fca953928e0d..da36d643b52f4998d6c6d0295e5e8f92447b4328 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -115,8 +115,8 @@ void ExtensionToolbarModel::MoveExtensionIcon(const std::string& id,
last_known_positions_.push_back(id);
}
- FOR_EACH_OBSERVER(
- Observer, observers_, ToolbarExtensionMoved(extension.get(), index));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionMoved(extension.get(), index));
MaybeUpdateVisibilityPref(extension.get(), index);
UpdatePrefs();
}
@@ -140,7 +140,7 @@ void ExtensionToolbarModel::SetVisibleIconCount(size_t count) {
prefs_->SetInteger(pref_names::kToolbarSize, visible_icon_count_);
}
- FOR_EACH_OBSERVER(Observer, observers_, ToolbarVisibleCountChanged());
+ FOR_EACH_OBSERVER(Observer, observers_, OnToolbarVisibleCountChanged());
}
void ExtensionToolbarModel::OnExtensionActionUpdated(
@@ -153,8 +153,8 @@ void ExtensionToolbarModel::OnExtensionActionUpdated(
// Notify observers if the extension exists and is in the model.
if (std::find(toolbar_items_.begin(), toolbar_items_.end(), extension) !=
toolbar_items_.end()) {
- FOR_EACH_OBSERVER(
- Observer, observers_, ToolbarExtensionUpdated(extension));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionUpdated(extension));
}
}
@@ -347,8 +347,8 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension) {
// to the full list (|toolbar_items_|, there won't be another *visible*
// browser action, which was what the observers care about.
if (!is_highlighting_) {
- FOR_EACH_OBSERVER(
- Observer, observers_, ToolbarExtensionAdded(extension, new_index));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionAdded(extension, new_index));
int visible_count_delta = 0;
if (is_new_extension && !all_icons_visible()) {
@@ -402,14 +402,15 @@ void ExtensionToolbarModel::RemoveExtension(const Extension* extension) {
extension);
if (pos != highlighted_items_.end()) {
highlighted_items_.erase(pos);
- FOR_EACH_OBSERVER(
- Observer, observers_, ToolbarExtensionRemoved(extension));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionRemoved(extension));
// If the highlighted list is now empty, we stop highlighting.
if (highlighted_items_.empty())
StopHighlighting();
}
} else {
- FOR_EACH_OBSERVER(Observer, observers_, ToolbarExtensionRemoved(extension));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionRemoved(extension));
}
UpdatePrefs();
@@ -594,8 +595,8 @@ void ExtensionToolbarModel::OnExtensionToolbarPrefChange() {
while (!toolbar_items_.empty()) {
scoped_refptr<const Extension> extension = toolbar_items_.back();
toolbar_items_.pop_back();
- FOR_EACH_OBSERVER(
- Observer, observers_, ToolbarExtensionRemoved(extension.get()));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionRemoved(extension.get()));
}
DCHECK(toolbar_items_.empty());
@@ -604,9 +605,8 @@ void ExtensionToolbarModel::OnExtensionToolbarPrefChange() {
// ...And notify.
for (size_t i = 0; i < toolbar_items().size(); ++i) {
- FOR_EACH_OBSERVER(Observer,
- observers_,
- ToolbarExtensionAdded(toolbar_items()[i].get(), i));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarExtensionAdded(toolbar_items()[i].get(), i));
}
if (last_known_positions_.size() > pref_position_size) {
@@ -694,7 +694,8 @@ bool ExtensionToolbarModel::HighlightExtensions(
if (visible_icon_count() < extension_ids.size())
SetVisibleIconCount(extension_ids.size());
- FOR_EACH_OBSERVER(Observer, observers_, ToolbarHighlightModeChanged(true));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarHighlightModeChanged(true));
return true;
}
@@ -711,7 +712,8 @@ void ExtensionToolbarModel::StopHighlighting() {
is_highlighting_ = false;
if (old_visible_icon_count_ != visible_icon_count_)
SetVisibleIconCount(old_visible_icon_count_);
- FOR_EACH_OBSERVER(Observer, observers_, ToolbarHighlightModeChanged(false));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnToolbarHighlightModeChanged(false));
}
}
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | chrome/browser/extensions/extension_toolbar_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698