| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ | 5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ |
| 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ | 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 | 9 |
| 10 class AutofillKey { | 10 class AutofillKey { |
| 11 public: | 11 public: |
| 12 AutofillKey(const string16& name, const string16& value) | 12 AutofillKey(const string16& name, const string16& value) |
| 13 : name_(name), | 13 : name_(name), |
| 14 value_(value) {} | 14 value_(value) {} |
| 15 AutofillKey(const AutofillKey& key) | 15 AutofillKey(const AutofillKey& key) |
| 16 : name_(key.name()), | 16 : name_(key.name()), |
| 17 value_(key.value()) {} | 17 value_(key.value()) {} |
| 18 virtual ~AutofillKey() {} | 18 virtual ~AutofillKey() {} |
| 19 | 19 |
| 20 const string16& name() const { return name_; } | 20 const string16& name() const { return name_; } |
| 21 const string16& value() const { return value_; } | 21 const string16& value() const { return value_; } |
| 22 | 22 |
| 23 bool operator==(const AutofillKey& key) const { | 23 bool operator==(const AutofillKey& key) const; |
| 24 return name_ == key.name() && value_ == key.value(); | |
| 25 } | |
| 26 | 24 |
| 27 private: | 25 private: |
| 28 string16 name_; | 26 string16 name_; |
| 29 string16 value_; | 27 string16 value_; |
| 30 }; | 28 }; |
| 31 | 29 |
| 32 class AutofillEntry { | 30 class AutofillEntry { |
| 33 public: | 31 public: |
| 34 explicit AutofillEntry(const AutofillKey& key) : key_(key) {} | 32 explicit AutofillEntry(const AutofillKey& key) : key_(key) {} |
| 35 | 33 |
| 36 const AutofillKey& key() const { return key_; } | 34 const AutofillKey& key() const { return key_; } |
| 37 | 35 |
| 38 private: | 36 private: |
| 39 AutofillKey key_; | 37 AutofillKey key_; |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ | 40 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__ |
| OLD | NEW |