Commit 0de630cb authored by sky@chromium.org's avatar sky@chromium.org

Attempt at fixing crash from ExtensionToolbarModel. See bug for

background as to what is happening. Long term the observer likely
needs a type parameter, but this is to stop the crashing.

BUG=142999
TEST=none
R=mpcomplete@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10830345

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151835 0039d316-1c4b-4281-b951-d872f2087c98
parent 93ab1fdd
......@@ -200,13 +200,19 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension,
last_extension_removed_index_ < list->size()) {
list->insert(list->begin() + last_extension_removed_index_,
make_scoped_refptr(extension));
// 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));
// 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_ = "";
last_extension_removed_index_ = -1;
......@@ -225,8 +231,11 @@ void ExtensionToolbarModel::RemoveExtension(const Extension* extension,
last_extension_removed_index_ = pos - list->begin();
list->erase(pos);
// TODO: figure out the right long term solution.
if (list == &toolbar_items_) {
FOR_EACH_OBSERVER(Observer, observers_,
BrowserActionRemoved(extension));
}
UpdatePrefs();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment