| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 RegisterStrings(localized_strings, resources, arraysize(resources)); | 218 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 219 RegisterTitle(localized_strings, "autofillOptionsPage", | 219 RegisterTitle(localized_strings, "autofillOptionsPage", |
| 220 IDS_AUTOFILL_OPTIONS_TITLE); | 220 IDS_AUTOFILL_OPTIONS_TITLE); |
| 221 | 221 |
| 222 SetAddressOverlayStrings(localized_strings); | 222 SetAddressOverlayStrings(localized_strings); |
| 223 SetCreditCardOverlayStrings(localized_strings); | 223 SetCreditCardOverlayStrings(localized_strings); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void AutofillOptionsHandler::Initialize() { | 226 void AutofillOptionsHandler::Initialize() { |
| 227 personal_data_ = web_ui_->GetProfile()->GetPersonalDataManager(); | 227 personal_data_ = Profile::FromWebUI(web_ui_)->GetPersonalDataManager(); |
| 228 personal_data_->SetObserver(this); | 228 personal_data_->SetObserver(this); |
| 229 | 229 |
| 230 LoadAutofillData(); | 230 LoadAutofillData(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void AutofillOptionsHandler::RegisterMessages() { | 233 void AutofillOptionsHandler::RegisterMessages() { |
| 234 web_ui_->RegisterMessageCallback( | 234 web_ui_->RegisterMessageCallback( |
| 235 "removeAddress", | 235 "removeAddress", |
| 236 NewCallback(this, &AutofillOptionsHandler::RemoveAddress)); | 236 NewCallback(this, &AutofillOptionsHandler::RemoveAddress)); |
| 237 web_ui_->RegisterMessageCallback( | 237 web_ui_->RegisterMessageCallback( |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void AutofillOptionsHandler::ValidateFaxNumbers(const ListValue* args) { | 537 void AutofillOptionsHandler::ValidateFaxNumbers(const ListValue* args) { |
| 538 if (!personal_data_->IsDataLoaded()) | 538 if (!personal_data_->IsDataLoaded()) |
| 539 return; | 539 return; |
| 540 | 540 |
| 541 ListValue* list_value = NULL; | 541 ListValue* list_value = NULL; |
| 542 ValidatePhoneArguments(args, &list_value); | 542 ValidatePhoneArguments(args, &list_value); |
| 543 | 543 |
| 544 web_ui_->CallJavascriptFunction( | 544 web_ui_->CallJavascriptFunction( |
| 545 "AutofillEditAddressOverlay.setValidatedFaxNumbers", *list_value); | 545 "AutofillEditAddressOverlay.setValidatedFaxNumbers", *list_value); |
| 546 } | 546 } |
| OLD | NEW |