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

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: 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 cdd91f5a973a1d0d8e0ba2b28e3f0da935a5f4b3..960b1f2d3f8af7279dbf385e590c0923ed61e6fd 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"
@@ -23,7 +24,8 @@
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.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 "components/favicon_base/favicon_types.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
@@ -70,7 +72,8 @@ class SortComparator : public std::binary_function<const BookmarkNode*,
// BookmarkModel --------------------------------------------------------------
-BookmarkModel::BookmarkModel(Profile* profile)
+BookmarkModel::BookmarkModel(Profile* profile,
+ bool index_urls)
: profile_(profile),
loaded_(false),
root_(GURL()),
@@ -79,6 +82,7 @@ BookmarkModel::BookmarkModel(Profile* profile)
mobile_node_(NULL),
next_node_id_(1),
observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY),
+ index_urls_(index_urls),
loaded_signal_(true, false),
extensive_changes_(0) {
if (!profile_) {
@@ -614,14 +618,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 +967,13 @@ 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_,
+ index_urls_,
+ profile_ ?
+ profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) :
+ std::string()),
+ next_node_id_);
}

Powered by Google App Engine
This is Rietveld 408576698