summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-11 15:22:32 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-11 15:22:32 +0000
commitd8e41ed4a55e60be60d47de5bbcb8a027e85a879 (patch)
treee0feaa030fe3834c0fc871de7564ef74e9595b05 /chrome/browser/autocomplete
parent7903e0262e2dda44eaa186d126cf88e2cc1470eb (diff)
downloadchromium_src-d8e41ed4a55e60be60d47de5bbcb8a027e85a879.zip
chromium_src-d8e41ed4a55e60be60d47de5bbcb8a027e85a879.tar.gz
chromium_src-d8e41ed4a55e60be60d47de5bbcb8a027e85a879.tar.bz2
Renames BoomarkBarModel to BookmarkModel.
BUG=none TEST=none Review URL: http://codereview.chromium.org/1912 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc8
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.cc16
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.h11
-rw-r--r--chrome/browser/autocomplete/history_contents_provider_unittest.cc6
-rw-r--r--chrome/browser/autocomplete/history_url_provider_unittest.cc6
-rw-r--r--chrome/browser/autocomplete/search_provider.cc1
6 files changed, 23 insertions, 25 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 42b6d81..27a3e7b 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/autocomplete/history_contents_provider.h"
#include "chrome/browser/autocomplete/keyword_provider.h"
#include "chrome/browser/autocomplete/search_provider.h"
-#include "chrome/browser/bookmarks/bookmark_bar_model.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/history_tab_ui.h"
#include "chrome/browser/profile.h"
@@ -394,12 +394,12 @@ void AutocompleteProvider::UpdateStarredStateOfMatches() {
if (!profile_)
return;
- BookmarkBarModel* bookmark_bar_model = profile_->GetBookmarkBarModel();
- if (!bookmark_bar_model || !bookmark_bar_model->IsLoaded())
+ BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
+ if (!bookmark_model || !bookmark_model->IsLoaded())
return;
for (ACMatches::iterator i = matches_.begin(); i != matches_.end(); ++i)
- i->starred = bookmark_bar_model->IsBookmarked(GURL(i->destination_url));
+ i->starred = bookmark_model->IsBookmarked(GURL(i->destination_url));
}
// AutocompleteResult ---------------------------------------------------------
diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc
index 2d03db9..d8c91e8 100644
--- a/chrome/browser/autocomplete/history_contents_provider.cc
+++ b/chrome/browser/autocomplete/history_contents_provider.cc
@@ -45,7 +45,7 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
if (input.text().empty() || (input.type() == AutocompleteInput::INVALID) ||
// The history service or bookmark bar model must exist.
!(profile_->GetHistoryService(Profile::EXPLICIT_ACCESS) ||
- profile_->GetBookmarkBarModel())) {
+ profile_->GetBookmarkModel())) {
Stop();
return;
}
@@ -191,8 +191,8 @@ AutocompleteMatch HistoryContentsProvider::ResultToMatch(
ACMatchClassification(0, ACMatchClassification::URL));
match.description = result.title();
match.starred =
- (profile_->GetBookmarkBarModel() &&
- profile_->GetBookmarkBarModel()->IsBookmarked(result.url()));
+ (profile_->GetBookmarkModel() &&
+ profile_->GetBookmarkModel()->IsBookmarked(result.url()));
ClassifyDescription(result, &match);
return match;
@@ -227,8 +227,8 @@ int HistoryContentsProvider::CalculateRelevance(
const history::URLResult& result) {
bool in_title = !!result.title_match_positions().size();
bool is_starred =
- (profile_->GetBookmarkBarModel() &&
- profile_->GetBookmarkBarModel()->IsBookmarked(result.url()));
+ (profile_->GetBookmarkModel() &&
+ profile_->GetBookmarkModel()->IsBookmarked(result.url()));
switch (input_type_) {
case AutocompleteInput::UNKNOWN:
@@ -258,7 +258,7 @@ int HistoryContentsProvider::CalculateRelevance(
}
void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) {
- BookmarkBarModel* bookmark_model = profile_->GetBookmarkBarModel();
+ BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
if (!bookmark_model)
return;
@@ -266,7 +266,7 @@ void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) {
// empty.
TimeTicks start_time = TimeTicks::Now();
- std::vector<BookmarkBarModel::TitleMatch> matches;
+ std::vector<BookmarkModel::TitleMatch> matches;
bookmark_model->GetBookmarksMatchingText(input.text(), kMaxMatchCount,
&matches);
for (size_t i = 0; i < matches.size(); ++i)
@@ -276,7 +276,7 @@ void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) {
}
void HistoryContentsProvider::AddBookmarkTitleMatchToResults(
- const BookmarkBarModel::TitleMatch& match) {
+ const BookmarkModel::TitleMatch& match) {
history::URLResult url_result(match.node->GetURL(), match.match_positions);
url_result.set_title(match.node->GetTitle());
results_.AppendURLBySwapping(&url_result);
diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h
index aded64d..f824480 100644
--- a/chrome/browser/autocomplete/history_contents_provider.h
+++ b/chrome/browser/autocomplete/history_contents_provider.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H__
#include "chrome/browser/autocomplete/autocomplete.h"
-#include "chrome/browser/bookmarks/bookmark_bar_model.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/history/history.h"
// HistoryContentsProvider is an AutocompleteProvider that provides results from
@@ -14,7 +14,7 @@
// HistoryContentsProvider gets results from two sources:
// . HistoryService: this provides results for matches in the body/title of
// previously viewed pages. This is asynchronous.
-// . BookmarkBarModel: provides results for matches in the titles of bookmarks.
+// . BookmarkModel: provides results for matches in the titles of bookmarks.
// This is synchronous.
class HistoryContentsProvider : public AutocompleteProvider {
public:
@@ -66,10 +66,9 @@ class HistoryContentsProvider : public AutocompleteProvider {
// matches are added directly to results_.
void QueryBookmarks(const AutocompleteInput& input);
- // Converts a BookmarkBarModel::TitleMatch to a QueryResult and adds it
- // to results_.
- void AddBookmarkTitleMatchToResults(
- const BookmarkBarModel::TitleMatch& match);
+ // Converts a BookmarkModel::TitleMatch to a QueryResult and adds it to
+ // results_.
+ void AddBookmarkTitleMatchToResults(const BookmarkModel::TitleMatch& match);
CancelableRequestConsumerT<int, 0> request_consumer_;
diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
index 5796f4d..5122071 100644
--- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
@@ -148,14 +148,14 @@ TEST_F(HistoryContentsProviderTest, MinimalChanges) {
EXPECT_EQ(2, m3.size());
}
-// Tests that the BookmarkBarModel is queried correctly.
+// Tests that the BookmarkModel is queried correctly.
TEST_F(HistoryContentsProviderTest, Bookmarks) {
- profile()->CreateBookmarkBarModel(false);
+ profile()->CreateBookmarkModel(false);
profile()->BlockUntilBookmarkModelLoaded();
// Add a bookmark.
GURL bookmark_url("http://www.google.com/4");
- profile()->GetBookmarkBarModel()->SetURLStarred(bookmark_url, L"bar", true);
+ profile()->GetBookmarkModel()->SetURLStarred(bookmark_url, L"bar", true);
AutocompleteInput input(L"bar", std::wstring(), true);
diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc
index e1b8ee8..b2663e6 100644
--- a/chrome/browser/autocomplete/history_url_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc
@@ -6,7 +6,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
-#include "chrome/browser/bookmarks/bookmark_bar_model.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/history/history.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -114,7 +114,7 @@ void HistoryURLProviderTest::OnProviderUpdate(bool updated_matches) {
void HistoryURLProviderTest::SetUp() {
profile_.reset(new TestingProfile());
- profile_->CreateBookmarkBarModel(true);
+ profile_->CreateBookmarkModel(true);
profile_->CreateHistoryService(true);
history_service_ = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
@@ -144,7 +144,7 @@ void HistoryURLProviderTest::FillData() {
cur.visit_count, cur.typed_count,
visit_time, false);
if (cur.starred) {
- profile_->GetBookmarkBarModel()->SetURLStarred(
+ profile_->GetBookmarkModel()->SetURLStarred(
current_url, std::wstring(), true);
}
}
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index e2be1a5..5ec75d2 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -6,7 +6,6 @@
#include "base/message_loop.h"
#include "base/string_util.h"
-#include "chrome/browser/bookmarks/bookmark_bar_model.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/google_util.h"
#include "chrome/browser/profile.h"