OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_ | |
7 | |
8 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | |
9 | |
10 namespace content { | |
11 class NavigationController; | |
12 } | |
13 | |
14 namespace gfx { | |
15 class Size; | |
16 } | |
17 | |
18 namespace autofill { | |
19 | |
20 class AutofillDialogViewDelegate; | |
21 | |
22 // An interface for the dialog that appears when a site initiates an Autofill | |
23 // action via the imperative autocomplete API. | |
24 class AutofillDialogView { | |
25 public: | |
26 virtual ~AutofillDialogView(); | |
27 | |
28 // Shows the dialog. | |
29 virtual void Show() = 0; | |
30 | |
31 // Closes the dialog window. May self-delete. | |
32 virtual void Hide() = 0; | |
33 | |
34 // A hint that the view is going to receive a series of Update* calls soon, | |
35 // and may want to delay visible changes until after the updates are over. | |
36 // As multiple calls to UpdatesStarted may be stacked, and the view should | |
37 // expect an equal number of calls to UpdateFinished(). | |
38 virtual void UpdatesStarted() = 0; | |
39 | |
40 // The matching call to UpdatesStarted. | |
41 virtual void UpdatesFinished() = 0; | |
42 | |
43 // Called when a different notification is available. | |
44 virtual void UpdateNotificationArea() = 0; | |
45 | |
46 // Updates the button strip based on the current controller state. | |
47 virtual void UpdateButtonStrip() = 0; | |
48 | |
49 // Updates the container for the detail inputs. | |
50 virtual void UpdateDetailArea() = 0; | |
51 | |
52 // Updates the validity status of the detail inputs. | |
53 virtual void UpdateForErrors() = 0; | |
54 | |
55 // Called when the contents of a section have changed. | |
56 virtual void UpdateSection(DialogSection section) = 0; | |
57 | |
58 // Updates the error bubble for this view. | |
59 virtual void UpdateErrorBubble() = 0; | |
60 | |
61 // Fills the given section with Autofill data that was triggered by a user | |
62 // interaction with |originating_input|. | |
63 virtual void FillSection(DialogSection section, | |
64 ServerFieldType originating_type) = 0; | |
65 | |
66 // Fills |output| with data the user manually input. | |
67 virtual void GetUserInput(DialogSection section, FieldValueMap* output) = 0; | |
68 | |
69 // Gets the CVC value the user typed to go along with the stored credit card | |
70 // data. If the user is inputing credit card data from scratch, this is not | |
71 // relevant. | |
72 virtual base::string16 GetCvc() = 0; | |
73 | |
74 // Returns true if new or edited autofill details should be saved. | |
75 virtual bool SaveDetailsLocally() = 0; | |
76 | |
77 // Called when the active suggestions data model changed. | |
78 virtual void ModelChanged() = 0; | |
79 | |
80 // Tells the view to validate its manual input in |section|. | |
81 virtual void ValidateSection(DialogSection section) = 0; | |
82 | |
83 // Factory function to create the dialog (implemented once per view | |
84 // implementation). |controller| will own the created dialog. | |
85 static AutofillDialogView* Create(AutofillDialogViewDelegate* delegate); | |
86 }; | |
87 | |
88 } // namespace autofill | |
89 | |
90 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_ | |
OLD | NEW |