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

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

Issue 329073003: Make HistoryQuickProvider::DeleteMatch also delete the underlying URL from the History Database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_quick_provider.cc
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 1391ca47b256e7ca294f22faf2f9495d870992ad..ea946e77aa6b7a0b7386def3812dbc8d7bfd9b9c 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -93,8 +93,16 @@ void HistoryQuickProvider::Start(const AutocompleteInput& input,
void HistoryQuickProvider::DeleteMatch(const AutocompleteMatch& match) {
Peter Kasting 2014/06/11 18:32:34 This function seems like it now just does what His
engedy 2014/06/12 08:47:59 Done. You are entirely correct. I actually feel ki
DCHECK(match.deletable);
DCHECK(match.destination_url.is_valid());
- // Delete the match from the InMemoryURLIndex.
+
+ // Delete the underlying URL along with all its visits from the history DB.
+ HistoryService* const history_service =
+ HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ DCHECK(history_service);
+ history_service->DeleteURL(match.destination_url);
+
+ // Delete derived information stored about the URL in the InMemoryURLIndex.
GetIndex()->DeleteURL(match.destination_url);
+
DeleteMatchFromMatches(match);
}
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698