summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bookmark_bar_view.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 22:49:41 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 22:49:41 +0000
commit28d8a20bdf9ea1c9e31096e3e34edb2df215dd30 (patch)
tree8b37b6826dbcece5b24a75f1546116686520f4a0 /chrome/browser/views/bookmark_bar_view.cc
parentecc737599bb0c64a07c2170e2c23bdc7da3a717e (diff)
downloadchromium_src-28d8a20bdf9ea1c9e31096e3e34edb2df215dd30.zip
chromium_src-28d8a20bdf9ea1c9e31096e3e34edb2df215dd30.tar.gz
chromium_src-28d8a20bdf9ea1c9e31096e3e34edb2df215dd30.tar.bz2
Fix bug where an extension toolstrip would sometimes get added twice to the
bookmark bar. The problem was that sometimes the EXTENSIONS_LOADED notification would get sent before we initialized the bookmark view (which adds the initial extension toolstrips). Review URL: http://codereview.chromium.org/42252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_bar_view.cc')
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 3fe0dbf..95f80fa 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -509,10 +509,21 @@ void BookmarkBarView::SetProfile(Profile* profile) {
ns->AddObserver(this, NotificationType::EXTENSIONS_LOADED,
NotificationService::AllSources());
+ // Add any already-loaded extensions now, since we missed the notification for
+ // those.
+ if (profile_->GetExtensionsService()) { // null in unit tests
+ if (AddExtensionToolstrips(
+ profile_->GetExtensionsService()->extensions())) {
+ Layout();
+ SchedulePaint();
+ }
+ }
+
model_ = profile_->GetBookmarkModel();
model_->AddObserver(this);
if (model_->IsLoaded())
Loaded(model_);
+
// else case: we'll receive notification back from the BookmarkModel when done
// loading, then we'll populate the bar.
}
@@ -1010,9 +1021,6 @@ void BookmarkBarView::Loaded(BookmarkModel* model) {
AddChildView(i, CreateBookmarkButton(node->GetChild(i)));
other_bookmarked_button_->SetEnabled(true);
- if (profile_->GetExtensionsService()) // null in unit tests
- AddExtensionToolstrips(profile_->GetExtensionsService()->extensions());
-
Layout();
SchedulePaint();
}