| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <utility> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/string16.h" | 11 #include "base/string16.h" |
| 11 #include "chrome/browser/autofill/field_types.h" | 12 #include "chrome/browser/autofill/field_types.h" |
| 12 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 13 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| 13 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 | 16 |
| 16 class Profile; | 17 class Profile; |
| 17 | 18 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 virtual string16 DialogTitle() const = 0; | 41 virtual string16 DialogTitle() const = 0; |
| 41 virtual string16 EditSuggestionText() const = 0; | 42 virtual string16 EditSuggestionText() const = 0; |
| 42 virtual string16 UseBillingForShippingText() const = 0; | 43 virtual string16 UseBillingForShippingText() const = 0; |
| 43 virtual string16 WalletOptionText() const = 0; | 44 virtual string16 WalletOptionText() const = 0; |
| 44 virtual string16 CancelButtonText() const = 0; | 45 virtual string16 CancelButtonText() const = 0; |
| 45 virtual string16 ConfirmButtonText() const = 0; | 46 virtual string16 ConfirmButtonText() const = 0; |
| 46 virtual string16 SignInText() const = 0; | 47 virtual string16 SignInText() const = 0; |
| 47 virtual string16 CancelSignInText() const = 0; | 48 virtual string16 CancelSignInText() const = 0; |
| 48 virtual string16 SaveLocallyText() const = 0; | 49 virtual string16 SaveLocallyText() const = 0; |
| 49 virtual string16 ProgressBarText() const = 0; | 50 virtual string16 ProgressBarText() const = 0; |
| 51 // Even indexed strings are text between links, odd are the text of links. |
| 52 virtual std::vector<string16> FootnoteLinkParts() const = 0; |
| 53 virtual string16 AcceptChangesText() const = 0; |
| 50 | 54 |
| 51 // State --------------------------------------------------------------------- | 55 // State --------------------------------------------------------------------- |
| 52 | 56 |
| 53 // Whether the user is known to be signed in. | 57 // Whether the user is known to be signed in. |
| 54 virtual DialogSignedInState SignedInState() const = 0; | 58 virtual DialogSignedInState SignedInState() const = 0; |
| 55 | 59 |
| 60 // Returns any dialog notification that should currently be showing. |
| 61 virtual DialogNotification CurrentNotification() const = 0; |
| 62 |
| 56 // Detail inputs ------------------------------------------------------------- | 63 // Detail inputs ------------------------------------------------------------- |
| 57 | 64 |
| 58 // Returns the set of inputs the page has requested which fall under | 65 // Returns the set of inputs the page has requested which fall under |
| 59 // |section|. | 66 // |section|. |
| 60 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 67 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
| 61 const = 0; | 68 const = 0; |
| 62 | 69 |
| 63 // Returns the combobox model for inputs of type |type|, or NULL if the input | 70 // Returns the combobox model for inputs of type |type|, or NULL if the input |
| 64 // should be a text field. | 71 // should be a text field. |
| 65 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 72 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 86 bool was_edit) = 0; | 93 bool was_edit) = 0; |
| 87 | 94 |
| 88 // The view forwards keypresses in text inputs. Returns true if there should | 95 // The view forwards keypresses in text inputs. Returns true if there should |
| 89 // be no further processing of the event. | 96 // be no further processing of the event. |
| 90 virtual bool HandleKeyPressEventInInput( | 97 virtual bool HandleKeyPressEventInInput( |
| 91 const content::NativeWebKeyboardEvent& event) = 0; | 98 const content::NativeWebKeyboardEvent& event) = 0; |
| 92 | 99 |
| 93 // Called when focus has changed position within the view. | 100 // Called when focus has changed position within the view. |
| 94 virtual void FocusMoved() = 0; | 101 virtual void FocusMoved() = 0; |
| 95 | 102 |
| 96 // Miscellany ---------------------------------------------------------------- | 103 // Actions ------------------------------------------------------------------- |
| 97 | |
| 98 // Called when the view has been closed. The value for |action| indicates | |
| 99 // whether the Autofill operation should be aborted. | |
| 100 virtual void ViewClosed(DialogAction action) = 0; | |
| 101 | |
| 102 // Returns any dialog notification that should currently be showing. | |
| 103 virtual DialogNotification CurrentNotification() const = 0; | |
| 104 | 104 |
| 105 // Begins the flow to sign into Wallet. | 105 // Begins the flow to sign into Wallet. |
| 106 virtual void StartSignInFlow() = 0; | 106 virtual void StartSignInFlow() = 0; |
| 107 | 107 |
| 108 // Marks the signin flow into Wallet complete. | 108 // Marks the signin flow into Wallet complete. |
| 109 virtual void EndSignInFlow() = 0; | 109 virtual void EndSignInFlow() = 0; |
| 110 | 110 |
| 111 // Accessors ----------------------------------------------------------------- |
| 112 |
| 111 // Returns the profile for this dialog. | 113 // Returns the profile for this dialog. |
| 112 virtual Profile* profile() = 0; | 114 virtual Profile* profile() = 0; |
| 113 | 115 |
| 114 // The web contents that prompted the dialog. | 116 // The web contents that prompted the dialog. |
| 115 virtual content::WebContents* web_contents() = 0; | 117 virtual content::WebContents* web_contents() = 0; |
| 116 | 118 |
| 119 // Event handlers ----------------------------------------------------------- |
| 120 |
| 121 virtual void LegalDocumentLinkClicked(size_t index) = 0; |
| 122 |
| 123 // Called when the view has been closed. The value for |action| indicates |
| 124 // whether the Autofill operation should be aborted. |
| 125 virtual void ViewClosed(DialogAction action) = 0; |
| 126 |
| 117 protected: | 127 protected: |
| 118 virtual ~AutofillDialogController(); | 128 virtual ~AutofillDialogController(); |
| 119 }; | 129 }; |
| 120 | 130 |
| 121 } // namespace autofill | 131 } // namespace autofill |
| 122 | 132 |
| 123 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ | 133 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
| OLD | NEW |