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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 RegisterStrings(localized_strings, resources, arraysize(resources)); | 293 RegisterStrings(localized_strings, resources, arraysize(resources)); |
294 RegisterTitle(localized_strings, "autofillOptionsPage", | 294 RegisterTitle(localized_strings, "autofillOptionsPage", |
295 IDS_AUTOFILL_OPTIONS_TITLE); | 295 IDS_AUTOFILL_OPTIONS_TITLE); |
296 | 296 |
297 localized_strings->SetString("helpUrl", chrome::kAutofillHelpURL); | 297 localized_strings->SetString("helpUrl", chrome::kAutofillHelpURL); |
298 SetAddressOverlayStrings(localized_strings); | 298 SetAddressOverlayStrings(localized_strings); |
299 SetCreditCardOverlayStrings(localized_strings); | 299 SetCreditCardOverlayStrings(localized_strings); |
300 } | 300 } |
301 | 301 |
302 void AutofillOptionsHandler::Initialize() { | 302 void AutofillOptionsHandler::InitializeHandler() { |
303 personal_data_ = PersonalDataManagerFactory::GetForProfile( | 303 personal_data_ = PersonalDataManagerFactory::GetForProfile( |
304 Profile::FromWebUI(web_ui())); | 304 Profile::FromWebUI(web_ui())); |
305 // personal_data_ is NULL in guest mode on Chrome OS. | 305 // personal_data_ is NULL in guest mode on Chrome OS. |
306 if (personal_data_) { | 306 if (personal_data_) { |
307 personal_data_->SetObserver(this); | 307 personal_data_->SetObserver(this); |
308 LoadAutofillData(); | 308 LoadAutofillData(); |
309 } | 309 } |
310 } | 310 } |
311 | 311 |
312 void AutofillOptionsHandler::RegisterMessages() { | 312 void AutofillOptionsHandler::RegisterMessages() { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 void AutofillOptionsHandler::ValidatePhoneNumbers(const ListValue* args) { | 609 void AutofillOptionsHandler::ValidatePhoneNumbers(const ListValue* args) { |
610 if (!personal_data_->IsDataLoaded()) | 610 if (!personal_data_->IsDataLoaded()) |
611 return; | 611 return; |
612 | 612 |
613 ListValue* list_value = NULL; | 613 ListValue* list_value = NULL; |
614 ValidatePhoneArguments(args, &list_value); | 614 ValidatePhoneArguments(args, &list_value); |
615 | 615 |
616 web_ui()->CallJavascriptFunction( | 616 web_ui()->CallJavascriptFunction( |
617 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); | 617 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); |
618 } | 618 } |
OLD | NEW |