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

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

Issue 5774004: Make HistoryContentsProvider results deletable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move DeleteMatch to common base class, update includes, etc. Created 10 years 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_url_provider.cc
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index 888a59f106bcf7dacf47679a4694735e580d22be..41fb155d8dfdb360cb3bd4b46d6422687fbf243b 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -147,40 +147,6 @@ void HistoryURLProvider::Stop() {
params_->cancel = true;
}
-void HistoryURLProvider::DeleteMatch(const AutocompleteMatch& match) {
- DCHECK(done_);
-
- // Delete the match from the history DB.
- HistoryService* const history_service =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
- GURL selected_url(match.destination_url);
- if (!history_service || !selected_url.is_valid()) {
- NOTREACHED() << "Can't delete requested URL";
- return;
- }
- history_service->DeleteURL(selected_url);
-
- // Delete the match from the current set of matches.
- bool found = false;
- for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
- if (i->destination_url == match.destination_url) {
- found = true;
- if (i->is_history_what_you_typed_match) {
- // We can't get rid of the What You Typed match, but we can make it
- // look like it has no backing data.
- i->deletable = false;
- i->description.clear();
- i->description_class.clear();
- } else {
- matches_.erase(i);
- }
- break;
- }
- }
- DCHECK(found) << "Asked to delete a URL that isn't in our set of matches";
- listener_->OnProviderUpdate(true);
-}
-
// Called on the history thread.
void HistoryURLProvider::ExecuteWithDB(history::HistoryBackend* backend,
history::URLDatabase* db,

Powered by Google App Engine
This is Rietveld 408576698