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

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

Issue 10830345: Attempt at fixing crash from ExtensionToolbarModel. See bug for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: 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 cc72665dc1cbaba95364f16c1c0ea22f75af55f9..dc1e4a4ea098a1fab9dad05c366bd6ddd4725f17 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -200,12 +200,18 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension,
last_extension_removed_index_ < list->size()) {
list->insert(list->begin() + last_extension_removed_index_,
make_scoped_refptr(extension));
- FOR_EACH_OBSERVER(Observer, observers_,
- BrowserActionAdded(extension, last_extension_removed_index_));
+ // TODO: figure out the right long term solution.
+ if (list == &toolbar_items_) {
+ FOR_EACH_OBSERVER(Observer, observers_,
+ BrowserActionAdded(extension, last_extension_removed_index_));
+ }
} else {
list->push_back(make_scoped_refptr(extension));
- FOR_EACH_OBSERVER(Observer, observers_,
- BrowserActionAdded(extension, list->size() - 1));
+ // TODO: figure out the right long term solution.
+ if (list == &toolbar_items_) {
+ FOR_EACH_OBSERVER(Observer, observers_,
+ BrowserActionAdded(extension, list->size() - 1));
+ }
}
last_extension_removed_ = "";
@@ -225,8 +231,11 @@ void ExtensionToolbarModel::RemoveExtension(const Extension* extension,
last_extension_removed_index_ = pos - list->begin();
list->erase(pos);
- FOR_EACH_OBSERVER(Observer, observers_,
- BrowserActionRemoved(extension));
+ // TODO: figure out the right long term solution.
+ if (list == &toolbar_items_) {
+ FOR_EACH_OBSERVER(Observer, observers_,
+ BrowserActionRemoved(extension));
+ }
UpdatePrefs();
}
« 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