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

Side by Side Diff: components/autofill/core/browser/phone_number.h

Issue 2110563002: Use AutofillProfileComparator in place of ad-hoc merge logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "components/autofill/core/browser/form_group.h" 14 #include "components/autofill/core/browser/form_group.h"
15 #include "components/autofill/core/browser/phone_number_i18n.h" 15 #include "components/autofill/core/browser/phone_number_i18n.h"
16 16
17 namespace autofill { 17 namespace autofill {
18 18
19 class AutofillProfile; 19 class AutofillProfile;
20 20
21 // A form group that stores phone number information. 21 // A form group that stores phone number information.
22 class PhoneNumber : public FormGroup { 22 class PhoneNumber : public FormGroup {
23 public: 23 public:
24 explicit PhoneNumber(AutofillProfile* profile); 24 explicit PhoneNumber(AutofillProfile* profile);
25 PhoneNumber(const PhoneNumber& number); 25 PhoneNumber(const PhoneNumber& number);
26 ~PhoneNumber() override; 26 ~PhoneNumber() override;
27 27
28 PhoneNumber& operator=(const PhoneNumber& number); 28 PhoneNumber& operator=(const PhoneNumber& number);
29 bool operator==(const PhoneNumber& other) const;
30 bool operator!=(const PhoneNumber& other) const { return !operator==(other); }
29 31
30 void set_profile(AutofillProfile* profile) { profile_ = profile; } 32 void set_profile(AutofillProfile* profile) { profile_ = profile; }
31 33
32 // FormGroup implementation: 34 // FormGroup implementation:
33 void GetMatchingTypes(const base::string16& text, 35 void GetMatchingTypes(const base::string16& text,
34 const std::string& app_locale, 36 const std::string& app_locale,
35 ServerFieldTypeSet* matching_types) const override; 37 ServerFieldTypeSet* matching_types) const override;
36 base::string16 GetRawInfo(ServerFieldType type) const override; 38 base::string16 GetRawInfo(ServerFieldType type) const override;
37 void SetRawInfo(ServerFieldType type, const base::string16& value) override; 39 void SetRawInfo(ServerFieldType type, const base::string16& value) override;
38 base::string16 GetInfo(const AutofillType& type, 40 base::string16 GetInfo(const AutofillType& type,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Profile which stores the region used as hint when normalizing the number. 90 // Profile which stores the region used as hint when normalizing the number.
89 const AutofillProfile* profile_; // WEAK 91 const AutofillProfile* profile_; // WEAK
90 92
91 // Cached number. 93 // Cached number.
92 mutable i18n::PhoneObject cached_parsed_phone_; 94 mutable i18n::PhoneObject cached_parsed_phone_;
93 }; 95 };
94 96
95 } // namespace autofill 97 } // namespace autofill
96 98
97 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_ 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/personal_data_manager_unittest.cc ('k') | components/autofill/core/browser/phone_number.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698