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