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_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
10 #include "base/memory/scoped_vector.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/scoped_observer.h"
13 #include "base/timer/timer.h"
14 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
15 #include "chrome/browser/ui/autofill/autofill_dialog_view.h"
16 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h"
17 #include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
18 #include "ui/base/animation/animation_delegate.h"
19 #include "ui/views/controls/button/button.h"
20 #include "ui/views/controls/button/menu_button.h"
21 #include "ui/views/controls/button/menu_button_listener.h"
22 #include "ui/views/controls/combobox/combobox_listener.h"
23 #include "ui/views/controls/link_listener.h"
24 #include "ui/views/controls/progress_bar.h"
25 #include "ui/views/controls/scroll_view.h"
26 #include "ui/views/controls/styled_label_listener.h"
27 #include "ui/views/controls/textfield/textfield_controller.h"
28 #include "ui/views/focus/focus_manager.h"
29 #include "ui/views/widget/widget_observer.h"
30 #include "ui/views/window/dialog_delegate.h"
59 class AutofillDialogSignInDelegate
;
60 class DecoratedTextfield
;
62 // Views toolkit implementation of the Autofill dialog that handles the
63 // imperative autocomplete API call.
64 class AutofillDialogViews
: public AutofillDialogView
,
65 public TestableAutofillDialogView
,
66 public views::DialogDelegateView
,
67 public views::WidgetObserver
,
68 public views::ButtonListener
,
69 public views::TextfieldController
,
70 public views::FocusChangeListener
,
71 public views::ComboboxListener
,
72 public views::StyledLabelListener
,
73 public views::MenuButtonListener
{
75 explicit AutofillDialogViews(AutofillDialogViewDelegate
* delegate
);
76 virtual ~AutofillDialogViews();
78 // AutofillDialogView implementation:
79 virtual void Show() OVERRIDE
;
80 virtual void Hide() OVERRIDE
;
81 virtual void UpdatesStarted() OVERRIDE
;
82 virtual void UpdatesFinished() OVERRIDE
;
83 virtual void UpdateAccountChooser() OVERRIDE
;
84 virtual void UpdateButtonStrip() OVERRIDE
;
85 virtual void UpdateDetailArea() OVERRIDE
;
86 virtual void UpdateForErrors() OVERRIDE
;
87 virtual void UpdateNotificationArea() OVERRIDE
;
88 virtual void UpdateSection(DialogSection section
) OVERRIDE
;
89 virtual void FillSection(DialogSection section
,
90 const DetailInput
& originating_input
) OVERRIDE
;
91 virtual void GetUserInput(DialogSection section
,
92 DetailOutputMap
* output
) OVERRIDE
;
93 virtual base::string16
GetCvc() OVERRIDE
;
94 virtual bool HitTestInput(const DetailInput
& input
,
95 const gfx::Point
& screen_point
) OVERRIDE
;
96 virtual bool SaveDetailsLocally() OVERRIDE
;
97 virtual const content::NavigationController
* ShowSignIn() OVERRIDE
;
98 virtual void HideSignIn() OVERRIDE
;
99 virtual void ModelChanged() OVERRIDE
;
100 virtual TestableAutofillDialogView
* GetTestableView() OVERRIDE
;
101 virtual void OnSignInResize(const gfx::Size
& pref_size
) OVERRIDE
;
103 // TestableAutofillDialogView implementation:
104 virtual void SubmitForTesting() OVERRIDE
;
105 virtual void CancelForTesting() OVERRIDE
;
106 virtual base::string16
GetTextContentsOfInput(
107 const DetailInput
& input
) OVERRIDE
;
108 virtual void SetTextContentsOfInput(const DetailInput
& input
,
109 const base::string16
& contents
) OVERRIDE
;
110 virtual void SetTextContentsOfSuggestionInput(
111 DialogSection section
,
112 const base::string16
& text
) OVERRIDE
;
113 virtual void ActivateInput(const DetailInput
& input
) OVERRIDE
;
114 virtual gfx::Size
GetSize() const OVERRIDE
;
116 // views::View implementation.
117 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
118 virtual void Layout() OVERRIDE
;
119 virtual void OnBoundsChanged(const gfx::Rect
& previous_bounds
) OVERRIDE
;
121 // views::DialogDelegate implementation:
122 virtual base::string16
GetWindowTitle() const OVERRIDE
;
123 virtual void WindowClosing() OVERRIDE
;
124 virtual void DeleteDelegate() OVERRIDE
;
125 virtual views::View
* CreateOverlayView() OVERRIDE
;
126 virtual int GetDialogButtons() const OVERRIDE
;
127 virtual base::string16
GetDialogButtonLabel(ui::DialogButton button
) const
129 virtual bool ShouldDefaultButtonBeBlue() const OVERRIDE
;
130 virtual bool IsDialogButtonEnabled(ui::DialogButton button
) const OVERRIDE
;
131 virtual views::View
* CreateExtraView() OVERRIDE
;
132 virtual views::View
* CreateTitlebarExtraView() OVERRIDE
;
133 virtual views::View
* CreateFootnoteView() OVERRIDE
;
134 virtual bool Cancel() OVERRIDE
;
135 virtual bool Accept() OVERRIDE
;
136 virtual views::NonClientFrameView
* CreateNonClientFrameView(
137 views::Widget
* widget
) OVERRIDE
;
139 // views::WidgetObserver implementation:
140 virtual void OnWidgetClosing(views::Widget
* widget
) OVERRIDE
;
141 virtual void OnWidgetBoundsChanged(views::Widget
* widget
,
142 const gfx::Rect
& new_bounds
) OVERRIDE
;
144 // views::ButtonListener implementation:
145 virtual void ButtonPressed(views::Button
* sender
,
146 const ui::Event
& event
) OVERRIDE
;
148 // views::TextfieldController implementation:
149 virtual void ContentsChanged(views::Textfield
* sender
,
150 const base::string16
& new_contents
) OVERRIDE
;
151 virtual bool HandleKeyEvent(views::Textfield
* sender
,
152 const ui::KeyEvent
& key_event
) OVERRIDE
;
153 virtual bool HandleMouseEvent(views::Textfield
* sender
,
154 const ui::MouseEvent
& key_event
) OVERRIDE
;
156 // views::FocusChangeListener implementation.
157 virtual void OnWillChangeFocus(views::View
* focused_before
,
158 views::View
* focused_now
) OVERRIDE
;
159 virtual void OnDidChangeFocus(views::View
* focused_before
,
160 views::View
* focused_now
) OVERRIDE
;
162 // views::ComboboxListener implementation:
163 virtual void OnSelectedIndexChanged(views::Combobox
* combobox
) OVERRIDE
;
165 // views::StyledLabelListener implementation:
166 virtual void StyledLabelLinkClicked(const ui::Range
& range
, int event_flags
)
169 // views::MenuButtonListener implementation.
170 virtual void OnMenuButtonClicked(views::View
* source
,
171 const gfx::Point
& point
) OVERRIDE
;
174 // A class that creates and manages a widget for error messages.
175 class ErrorBubble
: public views::WidgetObserver
{
177 ErrorBubble(views::View
* anchor
, const base::string16
& message
);
178 virtual ~ErrorBubble();
182 // Re-positions the bubble over |anchor_|. If |anchor_| is not visible,
183 // the bubble will hide.
184 void UpdatePosition();
186 virtual void OnWidgetClosing(views::Widget
* widget
) OVERRIDE
;
188 views::View
* anchor() { return anchor_
; }
191 // Calculates and returns the bounds of |widget_|, depending on |anchor_|
193 gfx::Rect
GetBoundsForWidget();
195 views::Widget
* widget_
; // Weak, may be NULL.
196 views::View
* anchor_
; // Weak.
197 // The contents view of |widget_|.
198 views::View
* contents_
; // Weak.
199 ScopedObserver
<views::Widget
, ErrorBubble
> observer_
;
201 DISALLOW_COPY_AND_ASSIGN(ErrorBubble
);
204 // A View which displays the currently selected account and lets the user
206 class AccountChooser
: public views::View
,
207 public views::LinkListener
,
208 public views::MenuButtonListener
,
209 public base::SupportsWeakPtr
<AccountChooser
> {
211 explicit AccountChooser(AutofillDialogViewDelegate
* delegate
);
212 virtual ~AccountChooser();
214 // Updates the view based on the state that |delegate_| reports.
217 // views::LinkListener implementation.
218 virtual void LinkClicked(views::Link
* source
, int event_flags
) OVERRIDE
;
220 // views::MenuButtonListener implementation.
221 virtual void OnMenuButtonClicked(views::View
* source
,
222 const gfx::Point
& point
) OVERRIDE
;
225 // The icon for the currently in-use account.
226 views::ImageView
* image_
;
228 // The button for showing a menu to change the currently in-use account.
229 views::MenuButton
* menu_button_
;
234 // The delegate |this| queries for logic and state.
235 AutofillDialogViewDelegate
* delegate_
;
237 // Runs the suggestion menu (triggered by each section's |suggested_button|.
238 scoped_ptr
<views::MenuRunner
> menu_runner_
;
240 DISALLOW_COPY_AND_ASSIGN(AccountChooser
);
243 // A view which displays an image, optionally some messages and a button. Used
244 // for the splash page as well as the Wallet interstitial.
245 class OverlayView
: public views::View
,
246 public ui::AnimationDelegate
{
248 // The listener is informed when |button_| is pressed.
249 explicit OverlayView(views::ButtonListener
* listener
);
250 virtual ~OverlayView();
252 // Returns a height which should be used when the contents view has width
253 // |w|. Note that the value returned should be used as the height of the
254 // dialog's contents.
255 int GetHeightForContentsForWidth(int width
);
257 // Sets properties that should be displayed.
258 void SetState(const DialogOverlayState
& state
,
259 views::ButtonListener
* listener
);
261 // Fades the view out after a delay.
264 // ui::AnimationDelegate implementation:
265 virtual void AnimationProgressed(const ui::Animation
* animation
) OVERRIDE
;
266 virtual void AnimationEnded(const ui::Animation
* animation
) OVERRIDE
;
268 // views::View implementation:
269 virtual gfx::Insets
GetInsets() const OVERRIDE
;
270 virtual void Layout() OVERRIDE
;
271 virtual const char* GetClassName() const OVERRIDE
;
272 virtual void OnPaint(gfx::Canvas
* canvas
) OVERRIDE
;
273 virtual void PaintChildren(gfx::Canvas
* canvas
) OVERRIDE
;
276 // Gets the border of the non-client frame view as a BubbleBorder.
277 views::BubbleBorder
* GetBubbleBorder();
279 // Gets the bounds of this view without the frame view's bubble border.
280 gfx::Rect
ContentBoundsSansBubbleBorder();
282 // Child View. Front and center.
283 views::ImageView
* image_view_
;
284 // Child View. When visible, below |image_view_|.
285 views::View
* message_stack_
;
286 // Child View. When visible, below |message_stack_|.
287 views::LabelButton
* button_
;
289 // This MultiAnimation is used to first fade out the contents of the
290 // overlay, then fade out the background of the overlay (revealing the
291 // dialog behind the overlay). This avoids cross-fade.
292 scoped_ptr
<ui::MultiAnimation
> fade_out_
;
294 DISALLOW_COPY_AND_ASSIGN(OverlayView
);
297 // An area for notifications. Some notifications point at the account chooser.
298 class NotificationArea
: public views::View
,
299 public views::ButtonListener
{
301 explicit NotificationArea(AutofillDialogViewDelegate
* delegate
);
302 virtual ~NotificationArea();
304 // Displays the given notifications.
305 void SetNotifications(const std::vector
<DialogNotification
>& notifications
);
307 // views::View implementation.
308 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
309 virtual const char* GetClassName() const OVERRIDE
;
310 virtual void PaintChildren(gfx::Canvas
* canvas
) OVERRIDE
;
311 virtual void OnPaint(gfx::Canvas
* canvas
) OVERRIDE
;
313 // views::ButtonListener implementation:
314 virtual void ButtonPressed(views::Button
* sender
,
315 const ui::Event
& event
) OVERRIDE
;
317 void set_arrow_centering_anchor(
318 const base::WeakPtr
<views::View
>& arrow_centering_anchor
) {
319 arrow_centering_anchor_
= arrow_centering_anchor
;
323 // Utility function for determining whether an arrow should be drawn
324 // pointing at |arrow_centering_anchor_|.
327 // A reference to the delegate/controller than owns this view.
328 // Used to report when checkboxes change their values.
329 AutofillDialogViewDelegate
* delegate_
; // weak
331 // The currently showing checkbox, or NULL if none exists.
332 views::Checkbox
* checkbox_
; // weak
334 // If HasArrow() is true, the arrow should point at this.
335 base::WeakPtr
<views::View
> arrow_centering_anchor_
;
337 std::vector
<DialogNotification
> notifications_
;
339 DISALLOW_COPY_AND_ASSIGN(NotificationArea
);
342 typedef std::map
<const DetailInput
*, DecoratedTextfield
*> TextfieldMap
;
343 typedef std::map
<const DetailInput
*, views::Combobox
*> ComboboxMap
;
345 // A view that packs a label on the left and some related controls
347 class SectionContainer
: public views::View
{
349 SectionContainer(const base::string16
& label
,
350 views::View
* controls
,
351 views::Button
* proxy_button
);
352 virtual ~SectionContainer();
354 // Sets the visual appearance of the section to active (considered active
355 // when showing the menu or hovered by the mouse cursor).
356 void SetActive(bool active
);
358 // Sets whether mouse events should be forwarded to |proxy_button_|.
359 void SetForwardMouseEvents(bool forward
);
361 // views::View implementation.
362 virtual void OnMouseMoved(const ui::MouseEvent
& event
) OVERRIDE
;
363 virtual void OnMouseEntered(const ui::MouseEvent
& event
) OVERRIDE
;
364 virtual void OnMouseExited(const ui::MouseEvent
& event
) OVERRIDE
;
365 virtual bool OnMousePressed(const ui::MouseEvent
& event
) OVERRIDE
;
366 virtual void OnMouseReleased(const ui::MouseEvent
& event
) OVERRIDE
;
369 // Converts |event| to one suitable for |proxy_button_|.
370 static ui::MouseEvent
ProxyEvent(const ui::MouseEvent
& event
);
372 // Mouse events on |this| are sent to this button.
373 views::Button
* proxy_button_
; // Weak reference.
375 // When true, mouse events will be forwarded to |proxy_button_|.
376 bool forward_mouse_events_
;
378 DISALLOW_COPY_AND_ASSIGN(SectionContainer
);
381 // A button to show address or billing suggestions.
382 class SuggestedButton
: public views::MenuButton
{
384 explicit SuggestedButton(views::MenuButtonListener
* listener
);
385 virtual ~SuggestedButton();
387 // views::MenuButton implementation.
388 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
389 virtual const char* GetClassName() const OVERRIDE
;
390 virtual void PaintChildren(gfx::Canvas
* canvas
) OVERRIDE
;
391 virtual void OnPaint(gfx::Canvas
* canvas
) OVERRIDE
;
394 // Returns the corred resource ID (i.e. IDR_*) for the current |state()|.
395 int ResourceIDForState() const;
397 DISALLOW_COPY_AND_ASSIGN(SuggestedButton
);
400 // A view that contains a suggestion (such as a known address) and a link to
401 // edit the suggestion.
402 class SuggestionView
: public views::View
{
404 explicit SuggestionView(AutofillDialogViews
* autofill_dialog
);
405 virtual ~SuggestionView();
407 void SetState(const SuggestionState
& state
);
409 // views::View implementation.
410 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
411 virtual int GetHeightForWidth(int width
) OVERRIDE
;
412 virtual void OnBoundsChanged(const gfx::Rect
& previous_bounds
) OVERRIDE
;
414 DecoratedTextfield
* decorated_textfield() { return decorated_
; }
417 // Returns whether there's room to display |state_.vertically_compact_text|
418 // without resorting to an ellipsis for a pixel width of |available_width|.
419 // Fills in |resulting_height| with the amount of space required to display
420 // |vertically_compact_text| or |horizontally_compact_text| as the case may
422 bool CanUseVerticallyCompactText(int available_width
,
423 int* resulting_height
);
425 // Sets the display text of the suggestion.
426 void SetLabelText(const base::string16
& text
);
428 // Sets the icon which should be displayed ahead of the text.
429 void SetIcon(const gfx::Image
& image
);
431 // Shows an auxiliary textfield to the right of the suggestion icon and
432 // text. This is currently only used to show a CVC field for the CC section.
433 void SetTextfield(const base::string16
& placeholder_text
,
434 const gfx::Image
& icon
);
436 // The state of |this|.
437 SuggestionState state_
;
439 // This caches preferred heights for given widths. The key is a preferred
440 // width, the value is a cached result of CanUseVerticallyCompactText.
441 std::map
<int, std::pair
<bool, int> > calculated_heights_
;
443 // The label that holds the suggestion description text.
444 views::Label
* label_
;
445 // The second (and greater) line of text that describes the suggestion.
446 views::Label
* label_line_2_
;
447 // The icon that comes just before |label_|.
448 views::ImageView
* icon_
;
449 // The input set by ShowTextfield.
450 DecoratedTextfield
* decorated_
;
451 // An "Edit" link that flips to editable inputs rather than suggestion text.
452 views::Link
* edit_link_
;
454 DISALLOW_COPY_AND_ASSIGN(SuggestionView
);
457 // A convenience struct for holding pointers to views within each detail
458 // section. None of the member pointers are owned.
459 struct DetailsGroup
{
460 explicit DetailsGroup(DialogSection section
);
463 // The section this group is associated with.
464 const DialogSection section
;
465 // The view that contains the entire section (label + input).
466 SectionContainer
* container
;
467 // The view that allows manual input.
468 views::View
* manual_input
;
469 // The textfields in |manual_input|, tracked by their DetailInput.
470 TextfieldMap textfields
;
471 // The comboboxes in |manual_input|, tracked by their DetailInput.
472 ComboboxMap comboboxes
;
473 // The view that holds the text of the suggested data. This will be
474 // visible IFF |manual_input| is not visible.
475 SuggestionView
* suggested_info
;
476 // The view that allows selecting other data suggestions.
477 SuggestedButton
* suggested_button
;
480 typedef std::map
<DialogSection
, DetailsGroup
> DetailGroupMap
;
482 gfx::Size
CalculatePreferredSize();
484 void InitChildViews();
486 // Creates and returns a view that holds all detail sections.
487 views::View
* CreateDetailsContainer();
489 // Creates and returns a view that holds the requesting host and intro text.
490 views::View
* CreateNotificationArea();
492 // Creates and returns a view that holds the main controls of this dialog.
493 views::View
* CreateMainContainer();
495 // Creates a detail section (Shipping, Email, etc.) with the given label,
496 // inputs View, and suggestion model. Relevant pointers are stored in |group|.
497 void CreateDetailsSection(DialogSection section
);
499 // Like CreateDetailsSection, but creates the combined billing/cc section,
500 // which is somewhat more complicated than the others.
501 void CreateBillingSection();
503 // Creates the view that holds controls for inputing or selecting data for
505 views::View
* CreateInputsContainer(DialogSection section
);
507 // Creates a grid of textfield views for the given section, and stores them
508 // in the appropriate DetailsGroup. The top level View in the hierarchy is
510 views::View
* InitInputsView(DialogSection section
);
512 // Updates the given section to match the state provided by |delegate_|. If
513 // |clobber_inputs| is true, the current state of the textfields will be
514 // ignored, otherwise their contents will be preserved.
515 void UpdateSectionImpl(DialogSection section
, bool clobber_inputs
);
517 // Updates the visual state of the given group as per the model.
518 void UpdateDetailsGroupState(const DetailsGroup
& group
);
520 // Gets a pointer to the DetailsGroup that's associated with the given section
522 DetailsGroup
* GroupForSection(DialogSection section
);
524 // Gets a pointer to the DetailsGroup that's associated with a given |view|.
525 // Returns NULL if no DetailsGroup was found.
526 DetailsGroup
* GroupForView(views::View
* view
);
528 // Sets the visual state for an input to be either valid or invalid. This
529 // should work on Comboboxes or DecoratedTextfields. If |message| is empty,
530 // the input is valid.
532 void SetValidityForInput(T
* input
, const base::string16
& message
);
534 // Shows an error bubble pointing at |view| if |view| has a message in
536 void ShowErrorBubbleForViewIfNecessary(views::View
* view
);
538 // Updates validity of the inputs in |section| with the new validity data.
539 void MarkInputsInvalid(DialogSection section
,
540 const ValidityData
& validity_data
);
542 // Checks all manual inputs in |group| for validity. Decorates the invalid
543 // ones and returns true if all were valid.
544 bool ValidateGroup(const DetailsGroup
& group
, ValidationType type
);
546 // Checks all manual inputs in the form for validity. Decorates the invalid
547 // ones and returns true if all were valid.
550 // When an input textfield is edited (its contents change) or activated
551 // (clicked while focused), this function will inform the delegate that it's
552 // time to show a suggestion popup and possibly reset the validity state of
554 void TextfieldEditedOrActivated(views::Textfield
* textfield
, bool was_edit
);
556 // Updates the views in the button strip.
557 void UpdateButtonStripExtraView();
559 // Call this when the size of anything in |contents_| might've changed.
560 void ContentsPreferredSizeChanged();
561 void DoContentsPreferredSizeChanged();
563 // Gets the textfield view that is shown for the given DetailInput model, or
565 views::Textfield
* TextfieldForInput(const DetailInput
& input
);
567 // Gets the combobox view that is shown for the given DetailInput model, or
569 views::Combobox
* ComboboxForInput(const DetailInput
& input
);
571 // Called when the details container changes in size or position.
572 void DetailsContainerBoundsChanged();
574 // The delegate that drives this view. Weak pointer, always non-NULL.
575 AutofillDialogViewDelegate
* const delegate_
;
577 // The preferred size of the view, cached to avoid needless recomputation.
578 gfx::Size preferred_size_
;
580 // The current number of unmatched calls to UpdatesStarted.
583 // True when there's been a call to ContentsPreferredSizeChanged() suppressed
584 // due to an unmatched UpdatesStarted.
587 // The window that displays |contents_|. Weak pointer; may be NULL when the
588 // dialog is closing.
589 views::Widget
* window_
;
591 // A timer used to coalesce re-layouts due to browser window resizes.
592 base::Timer browser_resize_timer_
;
594 // A DialogSection-keyed map of the DetailGroup structs.
595 DetailGroupMap detail_groups_
;
597 // Somewhere to show notification messages about errors, warnings, or promos.
598 NotificationArea
* notification_area_
;
600 // Runs the suggestion menu (triggered by each section's |suggested_button|.
601 scoped_ptr
<views::MenuRunner
> menu_runner_
;
603 // The view that allows the user to toggle the data source.
604 AccountChooser
* account_chooser_
;
606 // A WebView to that navigates to a Google sign-in page to allow the user to
608 views::WebView
* sign_in_webview_
;
610 // View that wraps |details_container_| and makes it scroll vertically.
611 views::ScrollView
* scrollable_area_
;
613 // View to host details sections.
614 views::View
* details_container_
;
616 // A view that overlays |this| (for "loading..." messages).
617 views::View
* loading_shield_
;
619 // The view that completely overlays the dialog (used for the splash page).
620 OverlayView
* overlay_view_
;
622 // The "Extra view" is on the same row as the dialog buttons.
623 views::View
* button_strip_extra_view_
;
625 // This checkbox controls whether new details are saved to the Autofill
626 // database. It lives in |extra_view_|.
627 views::Checkbox
* save_in_chrome_checkbox_
;
629 // Holds the above checkbox and an associated tooltip icon.
630 views::View
* save_in_chrome_checkbox_container_
;
632 // Used to display an image in the button strip extra view.
633 views::ImageView
* button_strip_image_
;
635 // View that aren't in the hierarchy but are owned by |this|. Currently
636 // just holds the (hidden) country comboboxes.
637 ScopedVector
<views::View
> other_owned_views_
;
639 // The view that is appended to the bottom of the dialog, below the button
640 // strip. Used to display legal document links.
641 views::View
* footnote_view_
;
643 // The legal document text and links.
644 views::StyledLabel
* legal_document_view_
;
646 // The focus manager for |window_|.
647 views::FocusManager
* focus_manager_
;
649 // The object that manages the error bubble widget.
650 scoped_ptr
<ErrorBubble
> error_bubble_
;
652 // Map from input view (textfield or combobox) to error string.
653 std::map
<views::View
*, base::string16
> validity_map_
;
655 ScopedObserver
<views::Widget
, AutofillDialogViews
> observer_
;
657 // Delegate for the sign-in dialog's webview.
658 scoped_ptr
<AutofillDialogSignInDelegate
> sign_in_delegate_
;
660 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews
);
663 } // namespace autofill
665 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_