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

Side by Side Diff: chrome/browser/history/in_memory_url_index.cc

Issue 10909046: Boost HQP Scores for Bookmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/history/scored_history_match.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/in_memory_url_index.h" 5 #include "chrome/browser/history/in_memory_url_index.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/api/bookmarks/bookmark_service.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h"
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
9 #include "chrome/browser/history/history_notifications.h" 12 #include "chrome/browser/history/history_notifications.h"
10 #include "chrome/browser/history/history_service_factory.h" 13 #include "chrome/browser/history/history_service_factory.h"
11 #include "chrome/browser/history/url_database.h" 14 #include "chrome/browser/history/url_database.h"
12 #include "chrome/browser/history/url_index_private_data.h" 15 #include "chrome/browser/history/url_index_private_data.h"
13 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/chrome_notification_types.h" 17 #include "chrome/common/chrome_notification_types.h"
15 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
16 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/notification_details.h" 20 #include "content/public/browser/notification_details.h"
18 #include "content/public/browser/notification_service.h" 21 #include "content/public/browser/notification_service.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (history_dir_.empty()) 157 if (history_dir_.empty())
155 return false; 158 return false;
156 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache")); 159 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache"));
157 return true; 160 return true;
158 } 161 }
159 162
160 // Querying -------------------------------------------------------------------- 163 // Querying --------------------------------------------------------------------
161 164
162 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( 165 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms(
163 const string16& term_string) { 166 const string16& term_string) {
164 return private_data_->HistoryItemsForTerms(term_string); 167 return private_data_->HistoryItemsForTerms(
168 term_string, BookmarkModelFactory::GetForProfile(profile_));
165 } 169 }
166 170
167 // Updating -------------------------------------------------------------------- 171 // Updating --------------------------------------------------------------------
168 172
169 void InMemoryURLIndex::Observe(int notification_type, 173 void InMemoryURLIndex::Observe(int notification_type,
170 const content::NotificationSource& source, 174 const content::NotificationSource& source,
171 const content::NotificationDetails& details) { 175 const content::NotificationDetails& details) {
172 switch (notification_type) { 176 switch (notification_type) {
173 case chrome::NOTIFICATION_HISTORY_URL_VISITED: 177 case chrome::NOTIFICATION_HISTORY_URL_VISITED:
174 OnURLVisited(content::Details<URLVisitedDetails>(details).ptr()); 178 OnURLVisited(content::Details<URLVisitedDetails>(details).ptr());
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 332 }
329 } 333 }
330 334
331 void InMemoryURLIndex::OnCacheSaveDone( 335 void InMemoryURLIndex::OnCacheSaveDone(
332 scoped_refptr<RefCountedBool> succeeded) { 336 scoped_refptr<RefCountedBool> succeeded) {
333 if (save_cache_observer_) 337 if (save_cache_observer_)
334 save_cache_observer_->OnCacheSaveFinished(succeeded->value()); 338 save_cache_observer_->OnCacheSaveFinished(succeeded->value());
335 } 339 }
336 340
337 } // namespace history 341 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/scored_history_match.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698