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

Unified Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 184663002: Omnibox: Make URLs of Bookmarks Searchable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pkasting and tfarina's comments Created 6 years, 8 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/bookmarks/bookmark_model.cc
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index afbe628b72db6b1c3cec08cde378436a8ed7b722..3dc6fb49be3df1226d25d0a92b50a01c350cc2a9 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/i18n/string_compare.h"
+#include "base/prefs/pref_service.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h"
#include "chrome/browser/bookmarks/bookmark_index.h"
@@ -24,7 +25,8 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/favicon/favicon_types.h"
-#include "components/bookmarks/core/browser/bookmark_title_match.h"
+#include "chrome/common/pref_names.h"
+#include "components/bookmarks/core/browser/bookmark_match.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "grit/generated_resources.h"
@@ -614,14 +616,14 @@ void BookmarkModel::ResetDateFolderModified(const BookmarkNode* node) {
SetDateFolderModified(node, Time());
}
-void BookmarkModel::GetBookmarksWithTitlesMatching(
+void BookmarkModel::GetBookmarksMatching(
const base::string16& text,
size_t max_count,
- std::vector<BookmarkTitleMatch>* matches) {
+ std::vector<BookmarkMatch>* matches) {
if (!loaded_)
return;
- index_->GetBookmarksWithTitlesMatching(text, max_count, matches);
+ index_->GetBookmarksMatching(text, max_count, matches);
}
void BookmarkModel::ClearStore() {
@@ -963,7 +965,12 @@ BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() {
CreatePermanentNode(BookmarkNode::OTHER_NODE);
BookmarkPermanentNode* mobile_node =
CreatePermanentNode(BookmarkNode::MOBILE);
- return new BookmarkLoadDetails(bb_node, other_node, mobile_node,
- new BookmarkIndex(profile_),
- next_node_id_);
+ return new BookmarkLoadDetails(
+ bb_node, other_node, mobile_node,
+ new BookmarkIndex(
+ profile_,
+ profile_ ?
+ profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) :
+ std::string()),
+ next_node_id_);
}

Powered by Google App Engine
This is Rietveld 408576698