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

Unified Diff: chrome/browser/autocomplete/history_contents_provider.cc

Issue 10831062: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
Index: chrome/browser/autocomplete/history_contents_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_contents_provider.cc (revision 148782)
+++ chrome/browser/autocomplete/history_contents_provider.cc (working copy)
@@ -12,6 +12,7 @@
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/autocomplete_provider_listener.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -71,7 +72,7 @@
// The history service or bookmark bar model must exist.
!(HistoryServiceFactory::GetForProfile(profile_,
Profile::EXPLICIT_ACCESS) ||
- profile_->GetBookmarkModel())) {
+ BookmarkModelFactory::GetForProfile(profile_))) {
Stop(false);
return;
}
@@ -222,9 +223,8 @@
match.contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::URL));
match.description = result.title();
- match.starred =
- (profile_->GetBookmarkModel() &&
- profile_->GetBookmarkModel()->IsBookmarked(result.url()));
+ BookmarkModel* bm_model = BookmarkModelFactory::GetForProfile(profile_);
+ match.starred = (bm_model && bm_model->IsBookmarked(result.url()));
ClassifyDescription(result, &match);
return match;
@@ -258,15 +258,16 @@
int HistoryContentsProvider::CalculateRelevance(
const history::URLResult& result) {
const bool in_title = MatchInTitle(result);
- if (!profile_->GetBookmarkModel() ||
- !profile_->GetBookmarkModel()->IsBookmarked(result.url()))
+ BookmarkModel* bm_model = BookmarkModelFactory::GetForProfile(profile_);
+ if (!bm_model || !bm_model->IsBookmarked(result.url()))
return in_title ? (700 + title_count_++) : (500 + contents_count_++);
return in_title ?
(1000 + star_title_count_++) : (550 + star_contents_count_++);
}
void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) {
- BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
+ BookmarkModel* bookmark_model =
+ BookmarkModelFactory::GetForProfile(profile_);
if (!bookmark_model)
return;

Powered by Google App Engine
This is Rietveld 408576698