| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/autocomplete/autocomplete_input.h" | 5 #include "chrome/browser/autocomplete/autocomplete_input.h" | 
| 6 | 6 | 
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" | 
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" | 
| 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 
| 10 #include "chrome/browser/net/url_fixer_upper.h" | 10 #include "chrome/browser/net/url_fixer_upper.h" | 
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 491 | 491 | 
| 492 void AutocompleteInput::UpdateText(const string16& text, | 492 void AutocompleteInput::UpdateText(const string16& text, | 
| 493                                    size_t cursor_position, | 493                                    size_t cursor_position, | 
| 494                                    const url_parse::Parsed& parts) { | 494                                    const url_parse::Parsed& parts) { | 
| 495   DCHECK(cursor_position <= text.length() || cursor_position == string16::npos); | 495   DCHECK(cursor_position <= text.length() || cursor_position == string16::npos); | 
| 496   text_ = text; | 496   text_ = text; | 
| 497   cursor_position_ = cursor_position; | 497   cursor_position_ = cursor_position; | 
| 498   parts_ = parts; | 498   parts_ = parts; | 
| 499 } | 499 } | 
| 500 | 500 | 
| 501 bool AutocompleteInput::Equals(const AutocompleteInput& other) const { |  | 
| 502   return (text_ == other.text_) && |  | 
| 503          (cursor_position_ == other.cursor_position_) && |  | 
| 504          (type_ == other.type_) && |  | 
| 505          (desired_tld_ == other.desired_tld_) && |  | 
| 506          (scheme_ == other.scheme_) && |  | 
| 507          (prevent_inline_autocomplete_ == other.prevent_inline_autocomplete_) && |  | 
| 508          (prefer_keyword_ == other.prefer_keyword_) && |  | 
| 509          (matches_requested_ == other.matches_requested_); |  | 
| 510 } |  | 
| 511 |  | 
| 512 void AutocompleteInput::Clear() { | 501 void AutocompleteInput::Clear() { | 
| 513   text_.clear(); | 502   text_.clear(); | 
| 514   cursor_position_ = string16::npos; | 503   cursor_position_ = string16::npos; | 
|  | 504   desired_tld_.clear(); | 
| 515   type_ = INVALID; | 505   type_ = INVALID; | 
| 516   parts_ = url_parse::Parsed(); | 506   parts_ = url_parse::Parsed(); | 
| 517   scheme_.clear(); | 507   scheme_.clear(); | 
| 518   desired_tld_.clear(); | 508   canonicalized_url_ = GURL(); | 
| 519   prevent_inline_autocomplete_ = false; | 509   prevent_inline_autocomplete_ = false; | 
| 520   prefer_keyword_ = false; | 510   prefer_keyword_ = false; | 
|  | 511   allow_exact_keyword_match_ = false; | 
|  | 512   matches_requested_ = ALL_MATCHES; | 
| 521 } | 513 } | 
| OLD | NEW | 
|---|