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

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

Issue 108643003: Omnibox: Bug Fixes for Shortcuts Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup comments; spacing Created 7 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_provider.cc
diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc
index 7474ce7e7ea27d3f51030d225e73cb7147843793..0fa0811742cda883c227f199dbfe038701e2fb5d 100644
--- a/chrome/browser/autocomplete/history_provider.cc
+++ b/chrome/browser/autocomplete/history_provider.cc
@@ -40,29 +40,6 @@ void HistoryProvider::DeleteMatch(const AutocompleteMatch& match) {
DeleteMatchFromMatches(match);
}
-HistoryProvider::~HistoryProvider() {}
-
-void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) {
- bool found = false;
- for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
- 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,
- // but we can make them look like they have 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);
-}
-
// static
bool HistoryProvider::FixupUserInput(AutocompleteInput* input) {
const base::string16& input_text = input->text();
@@ -134,6 +111,29 @@ bool HistoryProvider::FixupUserInput(AutocompleteInput* input) {
return !output.empty();
}
+HistoryProvider::~HistoryProvider() {}
+
+void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) {
+ bool found = false;
+ for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
+ 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,
+ // but we can make them look like they have 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);
+}
+
// static
size_t HistoryProvider::TrimHttpPrefix(base::string16* url) {
// Find any "http:".
@@ -191,4 +191,3 @@ ACMatchClassifications HistoryProvider::SpansFromTermMatch(
return spans;
}
-

Powered by Google App Engine
This is Rietveld 408576698