| 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_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 public: | 77 public: |
| 78 explicit AutofillDialogViews(AutofillDialogViewDelegate* delegate); | 78 explicit AutofillDialogViews(AutofillDialogViewDelegate* delegate); |
| 79 virtual ~AutofillDialogViews(); | 79 virtual ~AutofillDialogViews(); |
| 80 | 80 |
| 81 // AutofillDialogView implementation: | 81 // AutofillDialogView implementation: |
| 82 virtual void Show() OVERRIDE; | 82 virtual void Show() OVERRIDE; |
| 83 virtual void Hide() OVERRIDE; | 83 virtual void Hide() OVERRIDE; |
| 84 virtual void UpdatesStarted() OVERRIDE; | 84 virtual void UpdatesStarted() OVERRIDE; |
| 85 virtual void UpdatesFinished() OVERRIDE; | 85 virtual void UpdatesFinished() OVERRIDE; |
| 86 virtual void UpdateAccountChooser() OVERRIDE; | 86 virtual void UpdateAccountChooser() OVERRIDE; |
| 87 virtual void UpdateAutocheckoutStepsArea() OVERRIDE; | |
| 88 virtual void UpdateButtonStrip() OVERRIDE; | 87 virtual void UpdateButtonStrip() OVERRIDE; |
| 89 virtual void UpdateDetailArea() OVERRIDE; | 88 virtual void UpdateDetailArea() OVERRIDE; |
| 90 virtual void UpdateForErrors() OVERRIDE; | 89 virtual void UpdateForErrors() OVERRIDE; |
| 91 virtual void UpdateNotificationArea() OVERRIDE; | 90 virtual void UpdateNotificationArea() OVERRIDE; |
| 92 virtual void UpdateSection(DialogSection section) OVERRIDE; | 91 virtual void UpdateSection(DialogSection section) OVERRIDE; |
| 93 virtual void FillSection(DialogSection section, | 92 virtual void FillSection(DialogSection section, |
| 94 const DetailInput& originating_input) OVERRIDE; | 93 const DetailInput& originating_input) OVERRIDE; |
| 95 virtual void GetUserInput(DialogSection section, | 94 virtual void GetUserInput(DialogSection section, |
| 96 DetailOutputMap* output) OVERRIDE; | 95 DetailOutputMap* output) OVERRIDE; |
| 97 virtual base::string16 GetCvc() OVERRIDE; | 96 virtual base::string16 GetCvc() OVERRIDE; |
| 98 virtual bool SaveDetailsLocally() OVERRIDE; | 97 virtual bool SaveDetailsLocally() OVERRIDE; |
| 99 virtual const content::NavigationController* ShowSignIn() OVERRIDE; | 98 virtual const content::NavigationController* ShowSignIn() OVERRIDE; |
| 100 virtual void HideSignIn() OVERRIDE; | 99 virtual void HideSignIn() OVERRIDE; |
| 101 virtual void UpdateProgressBar(double value) OVERRIDE; | |
| 102 virtual void ModelChanged() OVERRIDE; | 100 virtual void ModelChanged() OVERRIDE; |
| 103 virtual TestableAutofillDialogView* GetTestableView() OVERRIDE; | 101 virtual TestableAutofillDialogView* GetTestableView() OVERRIDE; |
| 104 virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE; | 102 virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE; |
| 105 | 103 |
| 106 // TestableAutofillDialogView implementation: | 104 // TestableAutofillDialogView implementation: |
| 107 virtual void SubmitForTesting() OVERRIDE; | 105 virtual void SubmitForTesting() OVERRIDE; |
| 108 virtual void CancelForTesting() OVERRIDE; | 106 virtual void CancelForTesting() OVERRIDE; |
| 109 virtual base::string16 GetTextContentsOfInput( | 107 virtual base::string16 GetTextContentsOfInput( |
| 110 const DetailInput& input) OVERRIDE; | 108 const DetailInput& input) OVERRIDE; |
| 111 virtual void SetTextContentsOfInput(const DetailInput& input, | 109 virtual void SetTextContentsOfInput(const DetailInput& input, |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 TextfieldMap textfields; | 450 TextfieldMap textfields; |
| 453 // The comboboxes in |manual_input|, tracked by their DetailInput. | 451 // The comboboxes in |manual_input|, tracked by their DetailInput. |
| 454 ComboboxMap comboboxes; | 452 ComboboxMap comboboxes; |
| 455 // The view that holds the text of the suggested data. This will be | 453 // The view that holds the text of the suggested data. This will be |
| 456 // visible IFF |manual_input| is not visible. | 454 // visible IFF |manual_input| is not visible. |
| 457 SuggestionView* suggested_info; | 455 SuggestionView* suggested_info; |
| 458 // The view that allows selecting other data suggestions. | 456 // The view that allows selecting other data suggestions. |
| 459 views::ImageButton* suggested_button; | 457 views::ImageButton* suggested_button; |
| 460 }; | 458 }; |
| 461 | 459 |
| 462 // Area for displaying that status of various steps in an Autocheckout flow. | |
| 463 class AutocheckoutStepsArea : public views::View { | |
| 464 public: | |
| 465 AutocheckoutStepsArea(); | |
| 466 virtual ~AutocheckoutStepsArea() {} | |
| 467 | |
| 468 // Display the given steps. | |
| 469 void SetSteps(const std::vector<DialogAutocheckoutStep>& steps); | |
| 470 | |
| 471 private: | |
| 472 DISALLOW_COPY_AND_ASSIGN(AutocheckoutStepsArea); | |
| 473 }; | |
| 474 | |
| 475 class AutocheckoutProgressBar : public views::ProgressBar { | |
| 476 public: | |
| 477 AutocheckoutProgressBar(); | |
| 478 virtual ~AutocheckoutProgressBar(); | |
| 479 | |
| 480 private: | |
| 481 // Overriden from View | |
| 482 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 483 | |
| 484 DISALLOW_COPY_AND_ASSIGN(AutocheckoutProgressBar); | |
| 485 }; | |
| 486 | |
| 487 typedef std::map<DialogSection, DetailsGroup> DetailGroupMap; | 460 typedef std::map<DialogSection, DetailsGroup> DetailGroupMap; |
| 488 | 461 |
| 489 gfx::Size CalculatePreferredSize(); | 462 gfx::Size CalculatePreferredSize(); |
| 490 | 463 |
| 491 void InitChildViews(); | 464 void InitChildViews(); |
| 492 | 465 |
| 493 // Creates and returns a view that holds all detail sections. | 466 // Creates and returns a view that holds all detail sections. |
| 494 views::View* CreateDetailsContainer(); | 467 views::View* CreateDetailsContainer(); |
| 495 | 468 |
| 496 // Creates and returns a view that holds the requesting host and intro text. | 469 // Creates and returns a view that holds the requesting host and intro text. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 // Holds the above checkbox and an associated tooltip icon. | 609 // Holds the above checkbox and an associated tooltip icon. |
| 637 views::View* save_in_chrome_checkbox_container_; | 610 views::View* save_in_chrome_checkbox_container_; |
| 638 | 611 |
| 639 // Used to display an image in the button strip extra view. | 612 // Used to display an image in the button strip extra view. |
| 640 views::ImageView* button_strip_image_; | 613 views::ImageView* button_strip_image_; |
| 641 | 614 |
| 642 // View that aren't in the hierarchy but are owned by |this|. Currently | 615 // View that aren't in the hierarchy but are owned by |this|. Currently |
| 643 // just holds the (hidden) country comboboxes. | 616 // just holds the (hidden) country comboboxes. |
| 644 ScopedVector<views::View> other_owned_views_; | 617 ScopedVector<views::View> other_owned_views_; |
| 645 | 618 |
| 646 // View to host Autocheckout steps. | |
| 647 AutocheckoutStepsArea* autocheckout_steps_area_; | |
| 648 | |
| 649 // View to host |autocheckout_progress_bar_| and its label. | |
| 650 views::View* autocheckout_progress_bar_view_; | |
| 651 | |
| 652 // Progress bar for displaying Autocheckout progress. | |
| 653 AutocheckoutProgressBar* autocheckout_progress_bar_; | |
| 654 | |
| 655 // The view that is appended to the bottom of the dialog, below the button | 619 // The view that is appended to the bottom of the dialog, below the button |
| 656 // strip. Used to display legal document links. | 620 // strip. Used to display legal document links. |
| 657 views::View* footnote_view_; | 621 views::View* footnote_view_; |
| 658 | 622 |
| 659 // The legal document text and links. | 623 // The legal document text and links. |
| 660 views::StyledLabel* legal_document_view_; | 624 views::StyledLabel* legal_document_view_; |
| 661 | 625 |
| 662 // The focus manager for |window_|. | 626 // The focus manager for |window_|. |
| 663 views::FocusManager* focus_manager_; | 627 views::FocusManager* focus_manager_; |
| 664 | 628 |
| 665 // The object that manages the error bubble widget. | 629 // The object that manages the error bubble widget. |
| 666 scoped_ptr<ErrorBubble> error_bubble_; | 630 scoped_ptr<ErrorBubble> error_bubble_; |
| 667 | 631 |
| 668 // Map from input view (textfield or combobox) to error string. | 632 // Map from input view (textfield or combobox) to error string. |
| 669 std::map<views::View*, base::string16> validity_map_; | 633 std::map<views::View*, base::string16> validity_map_; |
| 670 | 634 |
| 671 ScopedObserver<views::Widget, AutofillDialogViews> observer_; | 635 ScopedObserver<views::Widget, AutofillDialogViews> observer_; |
| 672 | 636 |
| 673 // Delegate for the sign-in dialog's webview. | 637 // Delegate for the sign-in dialog's webview. |
| 674 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; | 638 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; |
| 675 | 639 |
| 676 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 640 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
| 677 }; | 641 }; |
| 678 | 642 |
| 679 } // namespace autofill | 643 } // namespace autofill |
| 680 | 644 |
| 681 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 645 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
| OLD | NEW |