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 #include "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
11 #include "base/i18n/timezone.h" | 11 #include "base/i18n/timezone.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/profiler/scoped_profile.h" | 15 #include "base/profiler/scoped_tracker.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "components/autofill/core/browser/address_i18n.h" | 19 #include "components/autofill/core/browser/address_i18n.h" |
20 #include "components/autofill/core/browser/autofill-inl.h" | 20 #include "components/autofill/core/browser/autofill-inl.h" |
21 #include "components/autofill/core/browser/autofill_country.h" | 21 #include "components/autofill/core/browser/autofill_country.h" |
22 #include "components/autofill/core/browser/autofill_field.h" | 22 #include "components/autofill/core/browser/autofill_field.h" |
23 #include "components/autofill/core/browser/form_structure.h" | 23 #include "components/autofill/core/browser/form_structure.h" |
24 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 24 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
25 #include "components/autofill/core/browser/phone_number.h" | 25 #include "components/autofill/core/browser/phone_number.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 CancelPendingQuery(&pending_profiles_query_); | 182 CancelPendingQuery(&pending_profiles_query_); |
183 CancelPendingQuery(&pending_creditcards_query_); | 183 CancelPendingQuery(&pending_creditcards_query_); |
184 | 184 |
185 if (database_.get()) | 185 if (database_.get()) |
186 database_->RemoveObserver(this); | 186 database_->RemoveObserver(this); |
187 } | 187 } |
188 | 188 |
189 void PersonalDataManager::OnWebDataServiceRequestDone( | 189 void PersonalDataManager::OnWebDataServiceRequestDone( |
190 WebDataServiceBase::Handle h, | 190 WebDataServiceBase::Handle h, |
191 const WDTypedResult* result) { | 191 const WDTypedResult* result) { |
192 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed. | 192 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422460 is fixed. |
193 tracked_objects::ScopedProfile tracking_profile( | 193 tracked_objects::ScopedTracker tracking_profile( |
194 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 194 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
195 "422460 PersonalDataManager::OnWebDataServiceRequestDone")); | 195 "422460 PersonalDataManager::OnWebDataServiceRequestDone")); |
196 | 196 |
197 DCHECK(pending_profiles_query_ || pending_creditcards_query_); | 197 DCHECK(pending_profiles_query_ || pending_creditcards_query_); |
198 | 198 |
199 if (!result) { | 199 if (!result) { |
200 // Error from the web database. | 200 // Error from the web database. |
201 if (h == pending_creditcards_query_) | 201 if (h == pending_creditcards_query_) |
202 pending_creditcards_query_ = 0; | 202 pending_creditcards_query_ = 0; |
203 else if (h == pending_profiles_query_) | 203 else if (h == pending_profiles_query_) |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 // Populates |auxiliary_profiles_|. | 1116 // Populates |auxiliary_profiles_|. |
1117 LoadAuxiliaryProfiles(record_metrics); | 1117 LoadAuxiliaryProfiles(record_metrics); |
1118 | 1118 |
1119 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 1119 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
1120 profiles_.insert( | 1120 profiles_.insert( |
1121 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); | 1121 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); |
1122 return profiles_; | 1122 return profiles_; |
1123 } | 1123 } |
1124 | 1124 |
1125 } // namespace autofill | 1125 } // namespace autofill |
OLD | NEW |