summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmark_bar_model.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
commit4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10 (patch)
treeeff001f3129de849da6e8658d45072c2ccf494f6 /chrome/browser/bookmark_bar_model.cc
parent50f2f629605750f033ef3c766498e42783a785f6 (diff)
downloadchromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.zip
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.gz
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.bz2
A set of tests to exercise chrome menus as well as parts of bookmark
bar view. These are disabled until we straighten out the buildbot that is always logged in. BUG=1318922 TEST=this is just a bunch of tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmark_bar_model.cc')
-rw-r--r--chrome/browser/bookmark_bar_model.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/chrome/browser/bookmark_bar_model.cc b/chrome/browser/bookmark_bar_model.cc
index 661f7c5..c6c9312 100644
--- a/chrome/browser/bookmark_bar_model.cc
+++ b/chrome/browser/bookmark_bar_model.cc
@@ -107,8 +107,13 @@ BookmarkBarModel::BookmarkBarModel(Profile* profile)
next_group_id_(HistoryService::kBookmarkBarID + 1),
bookmark_bar_node_(NULL),
other_node_(NULL) {
- if (!profile) {
- // Profile is NULL during testing.
+ // Notifications we want.
+ if (profile_)
+ NotificationService::current()->AddObserver(
+ this, NOTIFY_STARRED_FAVICON_CHANGED, Source<Profile>(profile_));
+
+ if (!profile || !profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)) {
+ // Profile/HistoryService is NULL during testing.
CreateBookmarkBarNode();
CreateOtherBookmarksNode();
AddRootChildren(NULL);
@@ -116,19 +121,11 @@ BookmarkBarModel::BookmarkBarModel(Profile* profile)
return;
}
- // Notifications we want.
- NotificationService::current()->AddObserver(
- this, NOTIFY_STARRED_FAVICON_CHANGED, Source<Profile>(profile_));
-
- // Request the entries from the database.
- HistoryService* history_service =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
- if (!history_service)
- return;
-
// Request the entries on the bookmark bar.
- history_service->GetAllStarredEntries(&load_consumer_,
- NewCallback(this, &BookmarkBarModel::OnGotStarredEntries));
+ profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->
+ GetAllStarredEntries(&load_consumer_,
+ NewCallback(this,
+ &BookmarkBarModel::OnGotStarredEntries));
}
BookmarkBarModel::~BookmarkBarModel() {