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

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

Issue 12039053: Fix cursor position for default provider searches in keyword mode. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added unit tests. Created 7 years, 11 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
Index: chrome/browser/autocomplete/autocomplete_input.cc
diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc
index 119758e1cd977c532c7460c1ff6c8fccc7bf8569..c23ffa144dc8aad31a8741392cc4feff6396b905 100644
--- a/chrome/browser/autocomplete/autocomplete_input.cc
+++ b/chrome/browser/autocomplete/autocomplete_input.cc
@@ -498,24 +498,31 @@ void AutocompleteInput::UpdateText(const string16& text,
parts_ = parts;
}
+// TODO: This method does not take into account |parts_|, because
+// url_parse::Parsed struct does not provide == operator.
bool AutocompleteInput::Equals(const AutocompleteInput& other) const {
Mark P 2013/01/24 04:07:21 Can you add a reminder by the block of variable de
Bart N. 2013/01/24 18:32:04 Done.
return (text_ == other.text_) &&
(cursor_position_ == other.cursor_position_) &&
- (type_ == other.type_) &&
(desired_tld_ == other.desired_tld_) &&
+ (type_ == other.type_) &&
(scheme_ == other.scheme_) &&
+ (canonicalized_url_ == other.canonicalized_url_) &&
(prevent_inline_autocomplete_ == other.prevent_inline_autocomplete_) &&
(prefer_keyword_ == other.prefer_keyword_) &&
+ (allow_exact_keyword_match_ == other.allow_exact_keyword_match_) &&
(matches_requested_ == other.matches_requested_);
}
void AutocompleteInput::Clear() {
text_.clear();
cursor_position_ = string16::npos;
+ desired_tld_.clear();
type_ = INVALID;
parts_ = url_parse::Parsed();
scheme_.clear();
- desired_tld_.clear();
+ canonicalized_url_ = GURL();
prevent_inline_autocomplete_ = false;
prefer_keyword_ = false;
+ allow_exact_keyword_match_ = false;
+ matches_requested_ = ALL_MATCHES;
}
« no previous file with comments | « no previous file | chrome/browser/autocomplete/keyword_provider.h » ('j') | chrome/browser/autocomplete/keyword_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698