OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 ///////////////////////////////////////////////////////////////////////////// | 258 ///////////////////////////////////////////////////////////////////////////// |
259 // PersonalDataManagerObserver implementation: | 259 // PersonalDataManagerObserver implementation: |
260 void AutofillOptionsHandler::OnPersonalDataChanged() { | 260 void AutofillOptionsHandler::OnPersonalDataChanged() { |
261 LoadAutofillData(); | 261 LoadAutofillData(); |
262 } | 262 } |
263 | 263 |
264 void AutofillOptionsHandler::SetAddressOverlayStrings( | 264 void AutofillOptionsHandler::SetAddressOverlayStrings( |
265 DictionaryValue* localized_strings) { | 265 DictionaryValue* localized_strings) { |
266 localized_strings->SetString("autofillEditAddressTitle", | 266 localized_strings->SetString("autofillEditAddressTitle", |
267 l10n_util::GetStringUTF16(IDS_AUTOFILL_EDIT_ADDRESS_CAPTION)); | 267 l10n_util::GetStringUTF16(IDS_AUTOFILL_EDIT_ADDRESS_CAPTION)); |
268 localized_strings->SetString("fullNameLabel", | 268 localized_strings->SetString("autofillFullNameLabel", |
269 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_FULL_NAME)); | 269 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_FULL_NAME)); |
270 localized_strings->SetString("companyNameLabel", | 270 localized_strings->SetString("autofillCompanyNameLabel", |
271 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_COMPANY_NAME)); | 271 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_COMPANY_NAME)); |
272 localized_strings->SetString("addrLine1Label", | 272 localized_strings->SetString("autofillAddrLine1Label", |
273 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADDRESS_LINE_1)); | 273 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADDRESS_LINE_1)); |
274 localized_strings->SetString("addrLine2Label", | 274 localized_strings->SetString("autofillAddrLine2Label", |
275 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADDRESS_LINE_2)); | 275 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADDRESS_LINE_2)); |
276 localized_strings->SetString("cityLabel", | 276 localized_strings->SetString("autofillCityLabel", |
277 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_CITY)); | 277 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_CITY)); |
278 localized_strings->SetString("countryLabel", | 278 localized_strings->SetString("autofillCountryLabel", |
279 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_COUNTRY)); | 279 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_COUNTRY)); |
280 localized_strings->SetString("phoneLabel", | 280 localized_strings->SetString("autofillPhoneLabel", |
281 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PHONE)); | 281 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PHONE)); |
282 localized_strings->SetString("emailLabel", | 282 localized_strings->SetString("autofillEmailLabel", |
283 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EMAIL)); | 283 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EMAIL)); |
284 localized_strings->SetString("addNewNamePlaceholder", | 284 localized_strings->SetString("addNewNamePlaceholder", |
285 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_NAME)); | 285 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_NAME)); |
286 localized_strings->SetString("addNewPhonePlaceholder", | 286 localized_strings->SetString("addNewPhonePlaceholder", |
287 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_PHONE)); | 287 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_PHONE)); |
288 localized_strings->SetString("addNewEmailPlaceholder", | 288 localized_strings->SetString("addNewEmailPlaceholder", |
289 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_EMAIL)); | 289 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_NEW_EMAIL)); |
290 | 290 |
291 std::string app_locale = AutofillCountry::ApplicationLocale(); | 291 std::string app_locale = AutofillCountry::ApplicationLocale(); |
292 std::string default_country_code = | 292 std::string default_country_code = |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 void AutofillOptionsHandler::ValidatePhoneNumbers(const ListValue* args) { | 516 void AutofillOptionsHandler::ValidatePhoneNumbers(const ListValue* args) { |
517 if (!personal_data_->IsDataLoaded()) | 517 if (!personal_data_->IsDataLoaded()) |
518 return; | 518 return; |
519 | 519 |
520 ListValue* list_value = NULL; | 520 ListValue* list_value = NULL; |
521 ValidatePhoneArguments(args, &list_value); | 521 ValidatePhoneArguments(args, &list_value); |
522 | 522 |
523 web_ui_->CallJavascriptFunction( | 523 web_ui_->CallJavascriptFunction( |
524 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); | 524 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); |
525 } | 525 } |
OLD | NEW |