OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/autofill_options_handler.h" | 5 #include "chrome/browser/dom_ui/autofill_options_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 localized_strings->SetString("addAddressButton", | 40 localized_strings->SetString("addAddressButton", |
41 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_ADDRESS_BUTTON)); | 41 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_ADDRESS_BUTTON)); |
42 localized_strings->SetString("addCreditCardButton", | 42 localized_strings->SetString("addCreditCardButton", |
43 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_CREDITCARD_BUTTON)); | 43 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_CREDITCARD_BUTTON)); |
44 localized_strings->SetString("editButton", | 44 localized_strings->SetString("editButton", |
45 l10n_util::GetStringUTF16(IDS_AUTOFILL_EDIT_BUTTON)); | 45 l10n_util::GetStringUTF16(IDS_AUTOFILL_EDIT_BUTTON)); |
46 localized_strings->SetString("deleteButton", | 46 localized_strings->SetString("deleteButton", |
47 l10n_util::GetStringUTF16(IDS_AUTOFILL_DELETE_BUTTON)); | 47 l10n_util::GetStringUTF16(IDS_AUTOFILL_DELETE_BUTTON)); |
48 localized_strings->SetString("helpButton", | 48 localized_strings->SetString("helpButton", |
49 l10n_util::GetStringUTF16(IDS_AUTOFILL_HELP_LABEL)); | 49 l10n_util::GetStringUTF16(IDS_AUTOFILL_HELP_LABEL)); |
| 50 localized_strings->SetString("addAddressTitle", |
| 51 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_ADDRESS_CAPTION)); |
| 52 localized_strings->SetString("addCreditCardTitle", |
| 53 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_CREDITCARD_CAPTION)); |
50 } | 54 } |
51 | 55 |
52 void AutoFillOptionsHandler::Initialize() { | 56 void AutoFillOptionsHandler::Initialize() { |
53 personal_data_ = | 57 personal_data_ = |
54 dom_ui_->GetProfile()->GetOriginalProfile()->GetPersonalDataManager(); | 58 dom_ui_->GetProfile()->GetOriginalProfile()->GetPersonalDataManager(); |
55 personal_data_->SetObserver(this); | 59 personal_data_->SetObserver(this); |
56 | 60 |
57 LoadAutoFillData(); | 61 LoadAutoFillData(); |
58 } | 62 } |
59 | 63 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 personal_data_->credit_cards().begin(); | 95 personal_data_->credit_cards().begin(); |
92 i != personal_data_->credit_cards().end(); ++i) { | 96 i != personal_data_->credit_cards().end(); ++i) { |
93 DictionaryValue* credit_card = new DictionaryValue(); | 97 DictionaryValue* credit_card = new DictionaryValue(); |
94 credit_card->SetString("label", (*i)->PreviewSummary()); | 98 credit_card->SetString("label", (*i)->PreviewSummary()); |
95 credit_cards.Append(credit_card); | 99 credit_cards.Append(credit_card); |
96 } | 100 } |
97 | 101 |
98 dom_ui_->CallJavascriptFunction(L"AutoFillOptions.updateCreditCards", | 102 dom_ui_->CallJavascriptFunction(L"AutoFillOptions.updateCreditCards", |
99 credit_cards); | 103 credit_cards); |
100 } | 104 } |
OLD | NEW |