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 #include "chrome/browser/autofill/personal_data_manager.h" | 5 #include "chrome/browser/autofill/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 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 !value.empty() && imported_profile->CountryCode().empty()) { | 287 !value.empty() && imported_profile->CountryCode().empty()) { |
288 imported_profile.reset(); | 288 imported_profile.reset(); |
289 break; | 289 break; |
290 } | 290 } |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 // Construct the phone number. Reject the profile if the number is invalid. | 294 // Construct the phone number. Reject the profile if the number is invalid. |
295 if (imported_profile.get() && !home.IsEmpty()) { | 295 if (imported_profile.get() && !home.IsEmpty()) { |
296 string16 constructed_number; | 296 string16 constructed_number; |
297 if (!home.ParseNumber(imported_profile->CountryCode(), | 297 if (!home.ParseNumber(*imported_profile, |
| 298 app_locale, |
298 &constructed_number) || | 299 &constructed_number) || |
299 !imported_profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, constructed_number, | 300 !imported_profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, constructed_number, |
300 app_locale)) { | 301 app_locale)) { |
301 imported_profile.reset(); | 302 imported_profile.reset(); |
302 } | 303 } |
303 } | 304 } |
304 | 305 |
305 // Reject the profile if minimum address and validation requirements are not | 306 // Reject the profile if minimum address and validation requirements are not |
306 // met. | 307 // met. |
307 if (imported_profile.get() && !IsValidLearnableProfile(*imported_profile)) | 308 if (imported_profile.get() && !IsValidLearnableProfile(*imported_profile)) |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 | 1003 |
1003 void PersonalDataManager::set_metric_logger( | 1004 void PersonalDataManager::set_metric_logger( |
1004 const AutofillMetrics* metric_logger) { | 1005 const AutofillMetrics* metric_logger) { |
1005 metric_logger_.reset(metric_logger); | 1006 metric_logger_.reset(metric_logger); |
1006 } | 1007 } |
1007 | 1008 |
1008 void PersonalDataManager::set_browser_context( | 1009 void PersonalDataManager::set_browser_context( |
1009 content::BrowserContext* context) { | 1010 content::BrowserContext* context) { |
1010 browser_context_ = context; | 1011 browser_context_ = context; |
1011 } | 1012 } |
OLD | NEW |