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 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <set> | 11 #include <set> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
20 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
21 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 21 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
22 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 22 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
23 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 23 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
24 #include "chrome/browser/ui/autofill/country_combobox_model.h" | 24 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
25 #include "components/autofill/core/browser/autofill_client.h" | 25 #include "components/autofill/core/browser/autofill_client.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 // Tells |view_| to update the validity status of its detail inputs (if | 258 // Tells |view_| to update the validity status of its detail inputs (if |
259 // |view_| is non-null). Currently this is used solely for highlighting | 259 // |view_| is non-null). Currently this is used solely for highlighting |
260 // invalid suggestions, so if no sections are based on existing data, | 260 // invalid suggestions, so if no sections are based on existing data, |
261 // |view_->UpdateForErrors()| is not called. | 261 // |view_->UpdateForErrors()| is not called. |
262 void UpdateForErrors(); | 262 void UpdateForErrors(); |
263 | 263 |
264 // Creates a DataModelWrapper item for the item that's checked in the | 264 // Creates a DataModelWrapper item for the item that's checked in the |
265 // suggestion model for |section|. This may represent Autofill | 265 // suggestion model for |section|. This may represent Autofill |
266 // data or Wallet data, depending on whether Wallet is currently enabled. | 266 // data or Wallet data, depending on whether Wallet is currently enabled. |
267 scoped_ptr<DataModelWrapper> CreateWrapper(DialogSection section); | 267 std::unique_ptr<DataModelWrapper> CreateWrapper(DialogSection section); |
268 | 268 |
269 // Fills in |section|-related fields in |output_| according to the state of | 269 // Fills in |section|-related fields in |output_| according to the state of |
270 // |view_|. | 270 // |view_|. |
271 void FillOutputForSection(DialogSection section); | 271 void FillOutputForSection(DialogSection section); |
272 // As above, but uses |compare| to determine whether a DetailInput matches | 272 // As above, but uses |compare| to determine whether a DetailInput matches |
273 // a field. Saves any new Autofill data to the PersonalDataManager. | 273 // a field. Saves any new Autofill data to the PersonalDataManager. |
274 void FillOutputForSectionWithComparator( | 274 void FillOutputForSectionWithComparator( |
275 DialogSection section, | 275 DialogSection section, |
276 const FormStructure::InputFieldComparator& compare); | 276 const FormStructure::InputFieldComparator& compare); |
277 | 277 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 // invoked is the same as |source_url_|. | 456 // invoked is the same as |source_url_|. |
457 bool invoked_from_same_origin_; | 457 bool invoked_from_same_origin_; |
458 | 458 |
459 // The URL of the invoking site. | 459 // The URL of the invoking site. |
460 GURL source_url_; | 460 GURL source_url_; |
461 | 461 |
462 // The callback via which we return the collected data. | 462 // The callback via which we return the collected data. |
463 AutofillClient::ResultCallback callback_; | 463 AutofillClient::ResultCallback callback_; |
464 | 464 |
465 // A helper to validate international address input. | 465 // A helper to validate international address input. |
466 scoped_ptr<AddressValidator> validator_; | 466 std::unique_ptr<AddressValidator> validator_; |
467 | 467 |
468 // The default active instrument and shipping address object IDs as of the | 468 // The default active instrument and shipping address object IDs as of the |
469 // last time Wallet items were fetched. These variables are only set | 469 // last time Wallet items were fetched. These variables are only set |
470 // (i.e. non-empty) when the Wallet items are being re-fetched. | 470 // (i.e. non-empty) when the Wallet items are being re-fetched. |
471 std::string previous_default_instrument_id_; | 471 std::string previous_default_instrument_id_; |
472 std::string previous_default_shipping_address_id_; | 472 std::string previous_default_shipping_address_id_; |
473 // The last active instrument and shipping address object IDs. These | 473 // The last active instrument and shipping address object IDs. These |
474 // variables are only set (i.e. non-empty) when the Wallet items are being | 474 // variables are only set (i.e. non-empty) when the Wallet items are being |
475 // re-fetched. | 475 // re-fetched. |
476 std::string previously_selected_instrument_id_; | 476 std::string previously_selected_instrument_id_; |
(...skipping 24 matching lines...) Expand all Loading... |
501 | 501 |
502 // The BCP 47 language codes used for formatting the addresses for display. | 502 // The BCP 47 language codes used for formatting the addresses for display. |
503 std::string billing_address_language_code_; | 503 std::string billing_address_language_code_; |
504 std::string shipping_address_language_code_; | 504 std::string shipping_address_language_code_; |
505 | 505 |
506 // Models for the credit card expiration inputs. | 506 // Models for the credit card expiration inputs. |
507 MonthComboboxModel cc_exp_month_combobox_model_; | 507 MonthComboboxModel cc_exp_month_combobox_model_; |
508 YearComboboxModel cc_exp_year_combobox_model_; | 508 YearComboboxModel cc_exp_year_combobox_model_; |
509 | 509 |
510 // Models for country input. | 510 // Models for country input. |
511 scoped_ptr<CountryComboboxModel> billing_country_combobox_model_; | 511 std::unique_ptr<CountryComboboxModel> billing_country_combobox_model_; |
512 scoped_ptr<CountryComboboxModel> shipping_country_combobox_model_; | 512 std::unique_ptr<CountryComboboxModel> shipping_country_combobox_model_; |
513 | 513 |
514 // Models for the suggestion views. | 514 // Models for the suggestion views. |
515 SuggestionsMenuModel suggested_cc_; | 515 SuggestionsMenuModel suggested_cc_; |
516 SuggestionsMenuModel suggested_billing_; | 516 SuggestionsMenuModel suggested_billing_; |
517 SuggestionsMenuModel suggested_shipping_; | 517 SuggestionsMenuModel suggested_shipping_; |
518 | 518 |
519 // The set of values for cc-type that the site accepts. Empty means all types | 519 // The set of values for cc-type that the site accepts. Empty means all types |
520 // are accepted. | 520 // are accepted. |
521 std::set<base::string16> acceptable_cc_types_; | 521 std::set<base::string16> acceptable_cc_types_; |
522 | 522 |
(...skipping 24 matching lines...) Expand all Loading... |
547 // they're manually filling the dialog). | 547 // they're manually filling the dialog). |
548 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; | 548 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; |
549 | 549 |
550 // The type of the visible Autofill popup input (or UNKNOWN_TYPE if none). | 550 // The type of the visible Autofill popup input (or UNKNOWN_TYPE if none). |
551 ServerFieldType popup_input_type_; | 551 ServerFieldType popup_input_type_; |
552 | 552 |
553 // The section of the dialog that's showing a popup, undefined if no popup | 553 // The section of the dialog that's showing a popup, undefined if no popup |
554 // is showing. | 554 // is showing. |
555 DialogSection popup_section_; | 555 DialogSection popup_section_; |
556 | 556 |
557 scoped_ptr<AutofillDialogView> view_; | 557 std::unique_ptr<AutofillDialogView> view_; |
558 | 558 |
559 // A NotificationRegistrar for tracking the completion of sign-in. | 559 // A NotificationRegistrar for tracking the completion of sign-in. |
560 content::NotificationRegistrar signin_registrar_; | 560 content::NotificationRegistrar signin_registrar_; |
561 | 561 |
562 // The countries the form structure can accept for shipping. | 562 // The countries the form structure can accept for shipping. |
563 std::set<base::string16> acceptable_shipping_countries_; | 563 std::set<base::string16> acceptable_shipping_countries_; |
564 | 564 |
565 // Whether |callback_| was Run() with a filled |form_structure_|. | 565 // Whether |callback_| was Run() with a filled |form_structure_|. |
566 bool data_was_passed_back_; | 566 bool data_was_passed_back_; |
567 | 567 |
(...skipping 12 matching lines...) Expand all Loading... |
580 base::OneShotTimer submit_button_delay_timer_; | 580 base::OneShotTimer submit_button_delay_timer_; |
581 | 581 |
582 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 582 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
583 | 583 |
584 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 584 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
585 }; | 585 }; |
586 | 586 |
587 } // namespace autofill | 587 } // namespace autofill |
588 | 588 |
589 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 589 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |