autofill_dialog_views.h revision 58e6fbe4ee35d65e14b626c557d37565bf8ad179
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_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
6#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
7
8#include <map>
9
10#include "base/memory/weak_ptr.h"
11#include "base/scoped_observer.h"
12#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
13#include "chrome/browser/ui/autofill/autofill_dialog_view.h"
14#include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
15#include "ui/base/animation/animation_delegate.h"
16#include "ui/views/controls/button/button.h"
17#include "ui/views/controls/button/menu_button_listener.h"
18#include "ui/views/controls/combobox/combobox_listener.h"
19#include "ui/views/controls/link_listener.h"
20#include "ui/views/controls/progress_bar.h"
21#include "ui/views/controls/scroll_view.h"
22#include "ui/views/controls/styled_label_listener.h"
23#include "ui/views/controls/textfield/textfield.h"
24#include "ui/views/controls/textfield/textfield_controller.h"
25#include "ui/views/focus/focus_manager.h"
26#include "ui/views/widget/widget_observer.h"
27#include "ui/views/window/dialog_delegate.h"
28
29namespace content {
30class KeyboardListener;
31}
32
33namespace gfx {
34class Image;
35}
36
37namespace views {
38class BubbleBorder;
39class Checkbox;
40class Combobox;
41class FocusableBorder;
42class FocusManager;
43class ImageButton;
44class ImageView;
45class Label;
46class LabelButton;
47class Link;
48class MenuRunner;
49class StyledLabel;
50class WebView;
51class Widget;
52}  // namespace views
53
54namespace ui {
55class ComboboxModel;
56class KeyEvent;
57class MultiAnimation;
58}
59
60namespace autofill {
61
62class AutofillDialogSignInDelegate;
63struct DetailInput;
64
65// Views toolkit implementation of the Autofill dialog that handles the
66// imperative autocomplete API call.
67class AutofillDialogViews : public AutofillDialogView,
68                            public TestableAutofillDialogView,
69                            public views::DialogDelegateView,
70                            public views::WidgetObserver,
71                            public views::ButtonListener,
72                            public views::TextfieldController,
73                            public views::FocusChangeListener,
74                            public views::ComboboxListener,
75                            public views::StyledLabelListener {
76 public:
77  explicit AutofillDialogViews(AutofillDialogController* controller);
78  virtual ~AutofillDialogViews();
79
80  // AutofillDialogView implementation:
81  virtual void Show() OVERRIDE;
82  virtual void Hide() OVERRIDE;
83  virtual void UpdateAccountChooser() OVERRIDE;
84  virtual void UpdateAutocheckoutStepsArea() OVERRIDE;
85  virtual void UpdateButtonStrip() OVERRIDE;
86  virtual void UpdateDetailArea() OVERRIDE;
87  virtual void UpdateForErrors() OVERRIDE;
88  virtual void UpdateNotificationArea() OVERRIDE;
89  virtual void UpdateSection(DialogSection section) OVERRIDE;
90  virtual void FillSection(DialogSection section,
91                           const DetailInput& originating_input) OVERRIDE;
92  virtual void GetUserInput(DialogSection section,
93                            DetailOutputMap* output) OVERRIDE;
94  virtual string16 GetCvc() OVERRIDE;
95  virtual bool SaveDetailsLocally() OVERRIDE;
96  virtual const content::NavigationController* ShowSignIn() OVERRIDE;
97  virtual void HideSignIn() OVERRIDE;
98  virtual void UpdateProgressBar(double value) OVERRIDE;
99  virtual void ModelChanged() OVERRIDE;
100  virtual TestableAutofillDialogView* GetTestableView() OVERRIDE;
101  virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE;
102
103  // TestableAutofillDialogView implementation:
104  virtual void SubmitForTesting() OVERRIDE;
105  virtual void CancelForTesting() OVERRIDE;
106  virtual string16 GetTextContentsOfInput(const DetailInput& input) OVERRIDE;
107  virtual void SetTextContentsOfInput(const DetailInput& input,
108                                      const string16& contents) OVERRIDE;
109  virtual void SetTextContentsOfSuggestionInput(
110      DialogSection section,
111      const base::string16& text) OVERRIDE;
112  virtual void ActivateInput(const DetailInput& input) OVERRIDE;
113  virtual gfx::Size GetSize() const OVERRIDE;
114
115  // views::View implementation.
116  virtual gfx::Size GetPreferredSize() OVERRIDE;
117  virtual void Layout() OVERRIDE;
118  virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
119
120  // views::DialogDelegate implementation:
121  virtual string16 GetWindowTitle() const OVERRIDE;
122  virtual void WindowClosing() OVERRIDE;
123  virtual void DeleteDelegate() OVERRIDE;
124  virtual views::View* CreateOverlayView() OVERRIDE;
125  virtual int GetDialogButtons() const OVERRIDE;
126  virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
127  virtual bool ShouldDefaultButtonBeBlue() const OVERRIDE;
128  virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE;
129  virtual views::View* CreateExtraView() OVERRIDE;
130  virtual views::View* CreateTitlebarExtraView() OVERRIDE;
131  virtual views::View* CreateFootnoteView() OVERRIDE;
132  virtual bool Cancel() OVERRIDE;
133  virtual bool Accept() OVERRIDE;
134  virtual views::NonClientFrameView* CreateNonClientFrameView(
135      views::Widget* widget) OVERRIDE;
136
137  // views::WidgetObserver implementation:
138  virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
139  virtual void OnWidgetBoundsChanged(views::Widget* widget,
140                                     const gfx::Rect& new_bounds) OVERRIDE;
141
142  // views::ButtonListener implementation:
143  virtual void ButtonPressed(views::Button* sender,
144                             const ui::Event& event) OVERRIDE;
145
146  // views::TextfieldController implementation:
147  virtual void ContentsChanged(views::Textfield* sender,
148                               const string16& new_contents) OVERRIDE;
149  virtual bool HandleKeyEvent(views::Textfield* sender,
150                              const ui::KeyEvent& key_event) OVERRIDE;
151  virtual bool HandleMouseEvent(views::Textfield* sender,
152                                const ui::MouseEvent& key_event) OVERRIDE;
153
154  // views::FocusChangeListener implementation.
155  virtual void OnWillChangeFocus(views::View* focused_before,
156                                 views::View* focused_now) OVERRIDE;
157  virtual void OnDidChangeFocus(views::View* focused_before,
158                                views::View* focused_now) OVERRIDE;
159
160  // views::ComboboxListener implementation:
161  virtual void OnSelectedIndexChanged(views::Combobox* combobox) OVERRIDE;
162
163  // views::StyledLabelListener implementation:
164  virtual void StyledLabelLinkClicked(const ui::Range& range, int event_flags)
165      OVERRIDE;
166
167 private:
168  // A class that creates and manages a widget for error messages.
169  class ErrorBubble : public views::WidgetObserver {
170   public:
171    ErrorBubble(views::View* anchor, const string16& message);
172    virtual ~ErrorBubble();
173
174    bool IsShowing();
175
176    // Re-positions the bubble over |anchor_|. If |anchor_| is not visible,
177    // the bubble will hide.
178    void UpdatePosition();
179
180    virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
181
182    views::View* anchor() { return anchor_; }
183
184   private:
185    // Calculates and returns the bounds of |widget_|, depending on |anchor_|
186    // and |contents_|.
187    gfx::Rect GetBoundsForWidget();
188
189    views::Widget* widget_;  // Weak, may be NULL.
190    views::View* anchor_;  // Weak.
191    // The contents view of |widget_|.
192    views::View* contents_;  // Weak.
193    ScopedObserver<views::Widget, ErrorBubble> observer_;
194
195    DISALLOW_COPY_AND_ASSIGN(ErrorBubble);
196  };
197
198  // A class which holds a textfield and draws extra stuff on top, like
199  // invalid content indications.
200  class DecoratedTextfield : public views::Textfield {
201   public:
202    DecoratedTextfield(const string16& default_value,
203                       const string16& placeholder,
204                       views::TextfieldController* controller);
205    virtual ~DecoratedTextfield();
206
207    // Sets whether to indicate the textfield has invalid content.
208    void SetInvalid(bool invalid);
209    bool invalid() const { return invalid_; }
210
211    // Sets the icon to be displayed inside the textfield at the end of the
212    // text.
213    void SetIcon(const gfx::Image& icon);
214
215    // views::View implementation.
216    virtual const char* GetClassName() const OVERRIDE;
217    virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE;
218    virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
219
220   private:
221    // We draw the border.
222    views::FocusableBorder* border_;  // Weak.
223
224    // The icon that goes at the right side of the textfield.
225    gfx::Image icon_;
226
227    // Whether the text contents are "invalid" (i.e. should special markers be
228    // shown to indicate invalidness).
229    bool invalid_;
230
231    DISALLOW_COPY_AND_ASSIGN(DecoratedTextfield);
232  };
233
234  // A View which displays the currently selected account and lets the user
235  // switch accounts.
236  class AccountChooser : public views::View,
237                         public views::LinkListener,
238                         public base::SupportsWeakPtr<AccountChooser> {
239   public:
240    explicit AccountChooser(AutofillDialogController* controller);
241    virtual ~AccountChooser();
242
243    // Updates the view based on the state that |controller_| reports.
244    void Update();
245
246    // views::View implementation.
247    virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
248    virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
249
250    // views::LinkListener implementation.
251    virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
252
253   private:
254    // The icon for the currently in-use account.
255    views::ImageView* image_;
256
257    // The label for the currently in-use account.
258    views::Label* label_;
259
260    // The drop arrow.
261    views::ImageView* arrow_;
262
263    // The sign in link.
264    views::Link* link_;
265
266    // The controller |this| queries for logic and state.
267    AutofillDialogController* controller_;
268
269    // Runs the suggestion menu (triggered by each section's |suggested_button|.
270    scoped_ptr<views::MenuRunner> menu_runner_;
271
272    DISALLOW_COPY_AND_ASSIGN(AccountChooser);
273  };
274
275  // A view which displays an image, optionally some messages and a button. Used
276  // for the splash page as well as the Wallet interstitial.
277  class OverlayView : public views::View,
278                      public ui::AnimationDelegate {
279   public:
280    // The listener is informed when |button_| is pressed.
281    explicit OverlayView(views::ButtonListener* listener);
282    virtual ~OverlayView();
283
284    // Sets properties that should be displayed.
285    void SetState(const DialogOverlayState& state,
286                  views::ButtonListener* listener);
287
288    // Fades the view out after a delay.
289    void BeginFadeOut();
290
291    // ui::AnimationDelegate implementation:
292    virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
293    virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
294
295    // views::View implementation:
296    virtual gfx::Insets GetInsets() const OVERRIDE;
297    virtual void Layout() OVERRIDE;
298    virtual const char* GetClassName() const OVERRIDE;
299    virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
300    virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE;
301
302   private:
303    // Gets the border of the non-client frame view as a BubbleBorder.
304    views::BubbleBorder* GetBubbleBorder();
305
306    // Gets the bounds of this view without the frame view's bubble border.
307    gfx::Rect ContentBoundsSansBubbleBorder();
308
309    // Child View. Front and center.
310    views::ImageView* image_view_;
311    // Child View. When visible, below |image_view_|.
312    views::View* message_stack_;
313    // Child View. When visible, below |message_stack_|.
314    views::LabelButton* button_;
315
316    // This MultiAnimation is used to first fade out the contents of the
317    // overlay, then fade out the background of the overlay (revealing the
318    // dialog behind the overlay). This avoids cross-fade.
319    scoped_ptr<ui::MultiAnimation> fade_out_;
320
321    DISALLOW_COPY_AND_ASSIGN(OverlayView);
322  };
323
324  // An area for notifications. Some notifications point at the account chooser.
325  class NotificationArea : public views::View,
326                           public views::ButtonListener {
327   public:
328    explicit NotificationArea(AutofillDialogController* controller);
329    virtual ~NotificationArea();
330
331    // Displays the given notifications.
332    void SetNotifications(const std::vector<DialogNotification>& notifications);
333
334    // views::View implementation.
335    virtual gfx::Size GetPreferredSize() OVERRIDE;
336    virtual const char* GetClassName() const OVERRIDE;
337    virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
338
339    // views::ButtonListener implementation:
340    virtual void ButtonPressed(views::Button* sender,
341                               const ui::Event& event) OVERRIDE;
342
343    void set_arrow_centering_anchor(
344        const base::WeakPtr<views::View>& arrow_centering_anchor) {
345      arrow_centering_anchor_ = arrow_centering_anchor;
346    }
347
348   private:
349    // Utility function for determining whether an arrow should be drawn
350    // pointing at |arrow_centering_anchor_|.
351    bool HasArrow();
352
353    // A reference to the controller than owns this view. Used to report when
354    // checkboxes change their values.
355    AutofillDialogController* controller_;  // weak
356
357    // The currently showing checkbox, or NULL if none exists.
358    views::Checkbox* checkbox_;  // weak
359
360    // If HasArrow() is true, the arrow should point at this.
361    base::WeakPtr<views::View> arrow_centering_anchor_;
362
363    std::vector<DialogNotification> notifications_;
364
365    DISALLOW_COPY_AND_ASSIGN(NotificationArea);
366  };
367
368  typedef std::map<const DetailInput*, DecoratedTextfield*> TextfieldMap;
369  typedef std::map<const DetailInput*, views::Combobox*> ComboboxMap;
370
371  // A view that packs a label on the left and some related controls
372  // on the right.
373  class SectionContainer : public views::View {
374   public:
375    SectionContainer(const string16& label,
376                     views::View* controls,
377                     views::Button* proxy_button);
378    virtual ~SectionContainer();
379
380    // Sets the visual appearance of the section to active (considered active
381    // when showing the menu or hovered by the mouse cursor).
382    void SetActive(bool active);
383
384    // Sets whether mouse events should be forwarded to |proxy_button_|.
385    void SetForwardMouseEvents(bool forward);
386
387    // views::View implementation.
388    virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
389    virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
390    virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
391    virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
392    virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
393
394   private:
395    // Converts |event| to one suitable for |proxy_button_|.
396    static ui::MouseEvent ProxyEvent(const ui::MouseEvent& event);
397
398    // Mouse events on |this| are sent to this button.
399    views::Button* proxy_button_;  // Weak reference.
400
401    // When true, mouse events will be forwarded to |proxy_button_|.
402    bool forward_mouse_events_;
403
404    DISALLOW_COPY_AND_ASSIGN(SectionContainer);
405  };
406
407  // A view that contains a suggestion (such as a known address) and a link to
408  // edit the suggestion.
409  class SuggestionView : public views::View {
410   public:
411    SuggestionView(const string16& edit_label,
412                   AutofillDialogViews* autofill_dialog);
413    virtual ~SuggestionView();
414
415    // Sets the display text of the suggestion.
416    void SetSuggestionText(const string16& text, gfx::Font::FontStyle style);
417
418    // Sets the icon which should be displayed ahead of the text.
419    void SetSuggestionIcon(const gfx::Image& image);
420
421    // Shows an auxiliary textfield to the right of the suggestion icon and
422    // text. This is currently only used to show a CVC field for the CC section.
423    void ShowTextfield(const string16& placeholder_text,
424                       const gfx::Image& icon);
425
426    DecoratedTextfield* decorated_textfield() { return decorated_; }
427
428   private:
429    // The label that holds the suggestion description text.
430    views::Label* label_;
431    // The second (and greater) line of text that describes the suggestion.
432    views::Label* label_line_2_;
433    // The icon that comes just before |label_|.
434    views::ImageView* icon_;
435    // A view to contain |label_| and |icon_|.
436    views::View* label_container_;
437    // The input set by ShowTextfield.
438    DecoratedTextfield* decorated_;
439    // An "Edit" link that flips to editable inputs rather than suggestion text.
440    views::Link* edit_link_;
441
442    DISALLOW_COPY_AND_ASSIGN(SuggestionView);
443  };
444
445  // A convenience struct for holding pointers to views within each detail
446  // section. None of the member pointers are owned.
447  struct DetailsGroup {
448    explicit DetailsGroup(DialogSection section);
449    ~DetailsGroup();
450
451    // The section this group is associated with.
452    const DialogSection section;
453    // The view that contains the entire section (label + input).
454    SectionContainer* container;
455    // The view that allows manual input.
456    views::View* manual_input;
457    // The textfields in |manual_input|, tracked by their DetailInput.
458    TextfieldMap textfields;
459    // The comboboxes in |manual_input|, tracked by their DetailInput.
460    ComboboxMap comboboxes;
461    // The view that holds the text of the suggested data. This will be
462    // visible IFF |manual_input| is not visible.
463    SuggestionView* suggested_info;
464    // The view that allows selecting other data suggestions.
465    views::ImageButton* suggested_button;
466  };
467
468  // Area for displaying that status of various steps in an Autocheckout flow.
469  class AutocheckoutStepsArea : public views::View {
470   public:
471    AutocheckoutStepsArea();
472    virtual ~AutocheckoutStepsArea() {}
473
474    // Display the given steps.
475    void SetSteps(const std::vector<DialogAutocheckoutStep>& steps);
476
477   private:
478    DISALLOW_COPY_AND_ASSIGN(AutocheckoutStepsArea);
479  };
480
481  class AutocheckoutProgressBar : public views::ProgressBar {
482   public:
483    AutocheckoutProgressBar();
484    virtual ~AutocheckoutProgressBar();
485
486   private:
487    // Overriden from View
488    virtual gfx::Size GetPreferredSize() OVERRIDE;
489
490    DISALLOW_COPY_AND_ASSIGN(AutocheckoutProgressBar);
491  };
492
493  typedef std::map<DialogSection, DetailsGroup> DetailGroupMap;
494
495  void InitChildViews();
496
497  // Creates and returns a view that holds all detail sections.
498  views::View* CreateDetailsContainer();
499
500  // Creates and returns a view that holds the requesting host and intro text.
501  views::View* CreateNotificationArea();
502
503  // Creates and returns a view that holds the main controls of this dialog.
504  views::View* CreateMainContainer();
505
506  // Creates a detail section (Shipping, Email, etc.) with the given label,
507  // inputs View, and suggestion model. Relevant pointers are stored in |group|.
508  void CreateDetailsSection(DialogSection section);
509
510  // Like CreateDetailsSection, but creates the combined billing/cc section,
511  // which is somewhat more complicated than the others.
512  void CreateBillingSection();
513
514  // Creates the view that holds controls for inputing or selecting data for
515  // a given section.
516  views::View* CreateInputsContainer(DialogSection section);
517
518  // Creates a grid of textfield views for the given section, and stores them
519  // in the appropriate DetailsGroup. The top level View in the hierarchy is
520  // returned.
521  views::View* InitInputsView(DialogSection section);
522
523  // Updates the given section to match the state provided by |controller_|. If
524  // |clobber_inputs| is true, the current state of the textfields will be
525  // ignored, otherwise their contents will be preserved.
526  void UpdateSectionImpl(DialogSection section, bool clobber_inputs);
527
528  // Updates the visual state of the given group as per the model.
529  void UpdateDetailsGroupState(const DetailsGroup& group);
530
531  // Gets a pointer to the DetailsGroup that's associated with the given section
532  // of the dialog.
533  DetailsGroup* GroupForSection(DialogSection section);
534
535  // Gets a pointer to the DetailsGroup that's associated with a given |view|.
536  // Returns NULL if no DetailsGroup was found.
537  DetailsGroup* GroupForView(views::View* view);
538
539  // Sets the visual state for an input to be either valid or invalid. This
540  // should work on Comboboxes or DecoratedTextfields. If |message| is empty,
541  // the input is valid.
542  template<class T>
543  void SetValidityForInput(T* input, const string16& message);
544
545  // Shows an error bubble pointing at |view| if |view| has a message in
546  // |validity_map_|.
547  void ShowErrorBubbleForViewIfNecessary(views::View* view);
548
549  // Updates validity of the inputs in |section| with the new validity data.
550  void MarkInputsInvalid(DialogSection section,
551                         const ValidityData& validity_data);
552
553  // Checks all manual inputs in |group| for validity. Decorates the invalid
554  // ones and returns true if all were valid.
555  bool ValidateGroup(const DetailsGroup& group, ValidationType type);
556
557  // Checks all manual inputs in the form for validity. Decorates the invalid
558  // ones and returns true if all were valid.
559  bool ValidateForm();
560
561  // When an input textfield is edited (its contents change) or activated
562  // (clicked while focused), this function will inform the controller that it's
563  // time to show a suggestion popup and possibly reset the validity state of
564  // the input.
565  void TextfieldEditedOrActivated(views::Textfield* textfield, bool was_edit);
566
567  // Updates the [X] Save in Chrome checkbox in the button strip.
568  void UpdateSaveInChromeCheckbox();
569
570  // Call this when the size of anything in |contents_| might've changed.
571  void ContentsPreferredSizeChanged();
572
573  // Gets the textfield view that is shown for the given DetailInput model, or
574  // NULL.
575  views::Textfield* TextfieldForInput(const DetailInput& input);
576
577  // Gets the combobox view that is shown for the given DetailInput model, or
578  // NULL.
579  views::Combobox* ComboboxForInput(const DetailInput& input);
580
581  // Called when the details container changes in size or position.
582  void DetailsContainerBoundsChanged();
583
584  // The controller that drives this view. Weak pointer, always non-NULL.
585  AutofillDialogController* const controller_;
586
587  // The window that displays |contents_|. Weak pointer; may be NULL when the
588  // dialog is closing.
589  views::Widget* window_;
590
591  // A DialogSection-keyed map of the DetailGroup structs.
592  DetailGroupMap detail_groups_;
593
594  // Somewhere to show notification messages about errors, warnings, or promos.
595  NotificationArea* notification_area_;
596
597  // Runs the suggestion menu (triggered by each section's |suggested_button|.
598  scoped_ptr<views::MenuRunner> menu_runner_;
599
600  // The view that allows the user to toggle the data source.
601  AccountChooser* account_chooser_;
602
603  // A WebView to that navigates to a Google sign-in page to allow the user to
604  // sign-in.
605  views::WebView* sign_in_webview_;
606
607  // View that wraps |details_container_| and makes it scroll vertically.
608  views::ScrollView* scrollable_area_;
609
610  // View to host details sections.
611  views::View* details_container_;
612
613  // A view that overlays |this| (for "loading..." messages).
614  views::Label* loading_shield_;
615
616  // The view that completely overlays the dialog (used for the splash page).
617  OverlayView* overlay_view_;
618
619  // The "Extra view" is on the same row as the dialog buttons.
620  views::View* button_strip_extra_view_;
621
622  // This checkbox controls whether new details are saved to the Autofill
623  // database. It lives in |extra_view_|.
624  views::Checkbox* save_in_chrome_checkbox_;
625
626  // View to host Autocheckout steps.
627  AutocheckoutStepsArea* autocheckout_steps_area_;
628
629  // View to host |autocheckout_progress_bar_| and its label.
630  views::View* autocheckout_progress_bar_view_;
631
632  // Progress bar for displaying Autocheckout progress.
633  AutocheckoutProgressBar* autocheckout_progress_bar_;
634
635  // The view that is appended to the bottom of the dialog, below the button
636  // strip. Used to display legal document links.
637  views::View* footnote_view_;
638
639  // The legal document text and links.
640  views::StyledLabel* legal_document_view_;
641
642  // The focus manager for |window_|.
643  views::FocusManager* focus_manager_;
644
645  // The object that manages the error bubble widget.
646  scoped_ptr<ErrorBubble> error_bubble_;
647
648  // Map from input view (textfield or combobox) to error string.
649  std::map<views::View*, string16> validity_map_;
650
651  ScopedObserver<views::Widget, AutofillDialogViews> observer_;
652
653  // Delegate for the sign-in dialog's webview.
654  scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_;
655
656  DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews);
657};
658
659}  // namespace autofill
660
661#endif  // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
662