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

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 missing () to the comment in omnibox_edit_model.cc Created 7 years, 10 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_input.h ('k') | chrome/browser/autocomplete/keyword_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..959d6ae9f102ae386b363338ce94d24e8efdb230 100644
--- a/chrome/browser/autocomplete/autocomplete_input.cc
+++ b/chrome/browser/autocomplete/autocomplete_input.cc
@@ -50,7 +50,8 @@ AutocompleteInput::AutocompleteInput(const string16& text,
prefer_keyword_(prefer_keyword),
allow_exact_keyword_match_(allow_exact_keyword_match),
matches_requested_(matches_requested) {
- DCHECK(cursor_position <= text.length() || cursor_position == string16::npos);
+ DCHECK(cursor_position <= text.length() || cursor_position == string16::npos)
+ << "Text: '" << text << "', cp: " << cursor_position;
// None of the providers care about leading white space so we always trim it.
// Providers that care about trailing white space handle trimming themselves.
if ((TrimWhitespace(text, TRIM_LEADING, &text_) & TRIM_LEADING) != 0)
@@ -492,30 +493,23 @@ int AutocompleteInput::NumNonHostComponents(const url_parse::Parsed& parts) {
void AutocompleteInput::UpdateText(const string16& text,
size_t cursor_position,
const url_parse::Parsed& parts) {
- DCHECK(cursor_position <= text.length() || cursor_position == string16::npos);
+ DCHECK(cursor_position <= text.length() || cursor_position == string16::npos)
+ << "Text: '" << text << "', cp: " << cursor_position;
text_ = text;
cursor_position_ = cursor_position;
parts_ = parts;
}
-bool AutocompleteInput::Equals(const AutocompleteInput& other) const {
- return (text_ == other.text_) &&
- (cursor_position_ == other.cursor_position_) &&
- (type_ == other.type_) &&
- (desired_tld_ == other.desired_tld_) &&
- (scheme_ == other.scheme_) &&
- (prevent_inline_autocomplete_ == other.prevent_inline_autocomplete_) &&
- (prefer_keyword_ == other.prefer_keyword_) &&
- (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 | « chrome/browser/autocomplete/autocomplete_input.h ('k') | chrome/browser/autocomplete/keyword_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698