| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/autofill/core/browser/suggestion.h" | 5 #include "components/autofill/core/browser/suggestion.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/autofill/core/browser/autofill_profile.h" | 8 #include "components/autofill/core/browser/autofill_profile.h" |
| 9 #include "components/autofill/core/browser/credit_card.h" | 9 #include "components/autofill/core/browser/credit_card.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 SuggestionBackendID::~SuggestionBackendID() { | 22 SuggestionBackendID::~SuggestionBackendID() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool SuggestionBackendID::operator<(const SuggestionBackendID& other) const { | 25 bool SuggestionBackendID::operator<(const SuggestionBackendID& other) const { |
| 26 if (variant != other.variant) | 26 if (variant != other.variant) |
| 27 return variant < other.variant; | 27 return variant < other.variant; |
| 28 return guid < other.guid; | 28 return guid < other.guid; |
| 29 } | 29 } |
| 30 | 30 |
| 31 Suggestion::Suggestion() | 31 Suggestion::Suggestion() |
| 32 : frontend_id(0) { | 32 : frontend_id(0), |
| 33 match(PREFIX_MATCH) { |
| 33 } | 34 } |
| 34 | 35 |
| 35 Suggestion::Suggestion(const Suggestion& other) | 36 Suggestion::Suggestion(const Suggestion& other) |
| 36 : backend_id(other.backend_id), | 37 : backend_id(other.backend_id), |
| 37 frontend_id(other.frontend_id), | 38 frontend_id(other.frontend_id), |
| 38 value(other.value), | 39 value(other.value), |
| 39 label(other.label), | 40 label(other.label), |
| 40 icon(other.icon) { | 41 icon(other.icon), |
| 42 match(other.match) { |
| 41 } | 43 } |
| 42 | 44 |
| 43 Suggestion::Suggestion(const base::string16& v) | 45 Suggestion::Suggestion(const base::string16& v) |
| 44 : frontend_id(0), | 46 : frontend_id(0), |
| 45 value(v) { | 47 value(v), |
| 48 match(PREFIX_MATCH) { |
| 46 } | 49 } |
| 47 | 50 |
| 48 Suggestion::Suggestion(const std::string& v, | 51 Suggestion::Suggestion(const std::string& v, |
| 49 const std::string& l, | 52 const std::string& l, |
| 50 const std::string& i, | 53 const std::string& i, |
| 51 int fid) | 54 int fid) |
| 52 : frontend_id(fid), | 55 : frontend_id(fid), |
| 53 value(base::UTF8ToUTF16(v)), | 56 value(base::UTF8ToUTF16(v)), |
| 54 label(base::UTF8ToUTF16(l)), | 57 label(base::UTF8ToUTF16(l)), |
| 55 icon(base::UTF8ToUTF16(i)) { | 58 icon(base::UTF8ToUTF16(i)), |
| 59 match(PREFIX_MATCH) { |
| 56 } | 60 } |
| 57 | 61 |
| 58 Suggestion::~Suggestion() { | 62 Suggestion::~Suggestion() { |
| 59 } | 63 } |
| 60 | 64 |
| 61 } // namespace autofill | 65 } // namespace autofill |
| OLD | NEW |