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/ui/webui/options/autofill_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/autofill_options_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EXPIRATION_DATE)); | 403 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EXPIRATION_DATE)); |
404 } | 404 } |
405 | 405 |
406 void AutofillOptionsHandler::LoadAutofillData() { | 406 void AutofillOptionsHandler::LoadAutofillData() { |
407 if (!IsPersonalDataLoaded()) | 407 if (!IsPersonalDataLoaded()) |
408 return; | 408 return; |
409 | 409 |
410 const std::vector<AutofillProfile*>& profiles = | 410 const std::vector<AutofillProfile*>& profiles = |
411 personal_data_->web_profiles(); | 411 personal_data_->web_profiles(); |
412 std::vector<base::string16> labels; | 412 std::vector<base::string16> labels; |
413 AutofillProfile::CreateDifferentiatingLabels(profiles, &labels); | 413 AutofillProfile::CreateDifferentiatingLabels( |
| 414 profiles, |
| 415 g_browser_process->GetApplicationLocale(), |
| 416 &labels); |
414 DCHECK_EQ(labels.size(), profiles.size()); | 417 DCHECK_EQ(labels.size(), profiles.size()); |
415 | 418 |
416 base::ListValue addresses; | 419 base::ListValue addresses; |
417 for (size_t i = 0; i < profiles.size(); ++i) { | 420 for (size_t i = 0; i < profiles.size(); ++i) { |
418 base::ListValue* entry = new base::ListValue(); | 421 base::ListValue* entry = new base::ListValue(); |
419 entry->Append(new base::StringValue(profiles[i]->guid())); | 422 entry->Append(new base::StringValue(profiles[i]->guid())); |
420 entry->Append(new base::StringValue(labels[i])); | 423 entry->Append(new base::StringValue(labels[i])); |
421 addresses.Append(entry); | 424 addresses.Append(entry); |
422 } | 425 } |
423 | 426 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 678 |
676 web_ui()->CallJavascriptFunction( | 679 web_ui()->CallJavascriptFunction( |
677 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); | 680 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); |
678 } | 681 } |
679 | 682 |
680 bool AutofillOptionsHandler::IsPersonalDataLoaded() const { | 683 bool AutofillOptionsHandler::IsPersonalDataLoaded() const { |
681 return personal_data_ && personal_data_->IsDataLoaded(); | 684 return personal_data_ && personal_data_->IsDataLoaded(); |
682 } | 685 } |
683 | 686 |
684 } // namespace options | 687 } // namespace options |
OLD | NEW |