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

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: Addressed Mark's comments. 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.
Peter Kasting 2013/01/28 00:04:22 Does it need to? Seems like if the other items in
Bart N. 2013/01/29 21:28:17 Technically speaking, not really, because we allow
Peter Kasting 2013/01/29 21:32:24 Really, no one uses it? If so, then please nuke i
bool AutocompleteInput::Equals(const AutocompleteInput& other) const {
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;
}

Powered by Google App Engine
This is Rietveld 408576698