OLD | NEW |
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_I18N_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_I18N_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_I18N_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_I18N_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 | 14 |
15 namespace i18n { | 15 namespace i18n { |
16 namespace phonenumbers { | 16 namespace phonenumbers { |
17 class PhoneNumber; | 17 class PhoneNumber; |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 namespace autofill { | 21 namespace autofill { |
22 | 22 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 PhoneObject& operator=(const PhoneObject& other); | 90 PhoneObject& operator=(const PhoneObject& other); |
91 | 91 |
92 bool IsValidNumber() const { return i18n_number_ != NULL; } | 92 bool IsValidNumber() const { return i18n_number_ != NULL; } |
93 | 93 |
94 private: | 94 private: |
95 // The region code for this phone number, inferred during parsing. | 95 // The region code for this phone number, inferred during parsing. |
96 std::string region_; | 96 std::string region_; |
97 | 97 |
98 // The parsed number and its components. | 98 // The parsed number and its components. |
99 // | 99 // |
100 scoped_ptr< ::i18n::phonenumbers::PhoneNumber> i18n_number_; | 100 std::unique_ptr<::i18n::phonenumbers::PhoneNumber> i18n_number_; |
101 base::string16 city_code_; | 101 base::string16 city_code_; |
102 base::string16 country_code_; | 102 base::string16 country_code_; |
103 base::string16 number_; | 103 base::string16 number_; |
104 | 104 |
105 // Pretty printed version of the whole number, or empty if parsing failed. | 105 // Pretty printed version of the whole number, or empty if parsing failed. |
106 // Set on first request. | 106 // Set on first request. |
107 mutable base::string16 formatted_number_; | 107 mutable base::string16 formatted_number_; |
108 | 108 |
109 // The whole number, normalized to contain only digits if possible. | 109 // The whole number, normalized to contain only digits if possible. |
110 // Set on first request. | 110 // Set on first request. |
111 mutable base::string16 whole_number_; | 111 mutable base::string16 whole_number_; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace i18n | 114 } // namespace i18n |
115 } // namespace autofill | 115 } // namespace autofill |
116 | 116 |
117 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_I18N_H_ | 117 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_NUMBER_I18N_H_ |
OLD | NEW |