Chromium Code Reviews| Index: chrome/browser/autocomplete/history_provider.cc |
| =================================================================== |
| --- chrome/browser/autocomplete/history_provider.cc (revision 103712) |
| +++ chrome/browser/autocomplete/history_provider.cc (working copy) |
| @@ -31,17 +31,15 @@ |
| profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| // Delete the match from the history DB. |
| - 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); |
| + DCHECK(history_service && match.destination_url.is_valid()); |
|
Peter Kasting
2011/10/05 00:11:42
Nit: I'd use two DCHECKs.
mrossetti
2011/10/07 17:04:14
Done.
|
| + history_service->DeleteURL(match.destination_url); |
| + DeleteMatchFromMatches(match); |
| +} |
| - // Delete the match from the current set of matches. |
| +void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) { |
| bool found = false; |
| for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) { |
| - if (i->destination_url == selected_url && i->type == match.type) { |
| + if (i->destination_url == match.destination_url && i->type == match.type) { |
| found = true; |
| if (i->is_history_what_you_typed_match || i->starred) { |
| // We can't get rid of What-You-Typed or Bookmarked matches, |