ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / ui / autofill / autofill_dialog_view.h
blob563d4921a06828a5a1849b4f75b4e3be88490b46
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.
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_
8 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h"
10 namespace content {
11 class NavigationController;
14 namespace gfx {
15 class Size;
18 namespace autofill {
20 class AutofillDialogViewDelegate;
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();
28 // Shows the dialog.
29 virtual void Show() = 0;
31 // Closes the dialog window. May self-delete.
32 virtual void Hide() = 0;
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;
40 // The matching call to UpdatesStarted.
41 virtual void UpdatesFinished() = 0;
43 // Called when a different notification is available.
44 virtual void UpdateNotificationArea() = 0;
46 // Updates the button strip based on the current controller state.
47 virtual void UpdateButtonStrip() = 0;
49 // Updates the container for the detail inputs.
50 virtual void UpdateDetailArea() = 0;
52 // Updates the validity status of the detail inputs.
53 virtual void UpdateForErrors() = 0;
55 // Called when the contents of a section have changed.
56 virtual void UpdateSection(DialogSection section) = 0;
58 // Updates the error bubble for this view.
59 virtual void UpdateErrorBubble() = 0;
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;
66 // Fills |output| with data the user manually input.
67 virtual void GetUserInput(DialogSection section, FieldValueMap* output) = 0;
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;
74 // Returns true if new or edited autofill details should be saved.
75 virtual bool SaveDetailsLocally() = 0;
77 // Called when the active suggestions data model changed.
78 virtual void ModelChanged() = 0;
80 // Tells the view to validate its manual input in |section|.
81 virtual void ValidateSection(DialogSection section) = 0;
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);
88 } // namespace autofill
90 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_H_