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 #ifndef COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // | 159 // |
160 // Also see SetProfile for more details. | 160 // Also see SetProfile for more details. |
161 virtual void Refresh(); | 161 virtual void Refresh(); |
162 | 162 |
163 const std::string& app_locale() const { return app_locale_; } | 163 const std::string& app_locale() const { return app_locale_; } |
164 | 164 |
165 // Checks suitability of |profile| for adding to the user's set of profiles. | 165 // Checks suitability of |profile| for adding to the user's set of profiles. |
166 static bool IsValidLearnableProfile(const AutofillProfile& profile, | 166 static bool IsValidLearnableProfile(const AutofillProfile& profile, |
167 const std::string& app_locale); | 167 const std::string& app_locale); |
168 | 168 |
169 // Merges |profile| into one of the |existing_profiles| if possible; otherwise | 169 // Merges |new_profile| into one of the |existing_profiles| if possible; |
170 // appends |profile| to the end of that list. Fills |merged_profiles| with the | 170 // otherwise appends |new_profile| to the end of that list. Fills |
171 // result. | 171 // |merged_profiles| with the result. |
172 static bool MergeProfile( | 172 static bool MergeProfile( |
173 const AutofillProfile& profile, | 173 const AutofillProfile& new_profile, |
174 const std::vector<AutofillProfile*>& existing_profiles, | 174 const std::vector<AutofillProfile*>& existing_profiles, |
175 const std::string& app_locale, | 175 const std::string& app_locale, |
176 std::vector<AutofillProfile>* merged_profiles); | 176 std::vector<AutofillProfile>* merged_profiles); |
177 | 177 |
178 protected: | 178 protected: |
179 // Only PersonalDataManagerFactory and certain tests can create instances of | 179 // Only PersonalDataManagerFactory and certain tests can create instances of |
180 // PersonalDataManager. | 180 // PersonalDataManager. |
181 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast); | 181 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast); |
182 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup); | 182 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup); |
183 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, | 183 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 // Whether we have already logged the number of profiles this session. | 283 // Whether we have already logged the number of profiles this session. |
284 mutable bool has_logged_profile_count_; | 284 mutable bool has_logged_profile_count_; |
285 | 285 |
286 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 286 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
287 }; | 287 }; |
288 | 288 |
289 } // namespace autofill | 289 } // namespace autofill |
290 | 290 |
291 #endif // COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ | 291 #endif // COMPONENTS_AUTOFILL_BROWSER_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |