OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
12 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 12 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
13 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 13 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
14 #include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h" | 14 #include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h" |
15 #include "ui/base/accelerators/accelerator.h" | 15 #include "ui/base/accelerators/accelerator.h" |
| 16 #include "ui/base/animation/animation_delegate.h" |
16 #include "ui/views/controls/button/button.h" | 17 #include "ui/views/controls/button/button.h" |
17 #include "ui/views/controls/button/menu_button_listener.h" | 18 #include "ui/views/controls/button/menu_button_listener.h" |
18 #include "ui/views/controls/combobox/combobox_listener.h" | 19 #include "ui/views/controls/combobox/combobox_listener.h" |
19 #include "ui/views/controls/link_listener.h" | 20 #include "ui/views/controls/link_listener.h" |
20 #include "ui/views/controls/progress_bar.h" | 21 #include "ui/views/controls/progress_bar.h" |
21 #include "ui/views/controls/scroll_view.h" | 22 #include "ui/views/controls/scroll_view.h" |
22 #include "ui/views/controls/styled_label_listener.h" | 23 #include "ui/views/controls/styled_label_listener.h" |
23 #include "ui/views/controls/textfield/textfield.h" | 24 #include "ui/views/controls/textfield/textfield.h" |
24 #include "ui/views/controls/textfield/textfield_controller.h" | 25 #include "ui/views/controls/textfield/textfield_controller.h" |
25 #include "ui/views/focus/focus_manager.h" | 26 #include "ui/views/focus/focus_manager.h" |
26 #include "ui/views/widget/widget_observer.h" | 27 #include "ui/views/widget/widget_observer.h" |
27 #include "ui/views/window/dialog_delegate.h" | 28 #include "ui/views/window/dialog_delegate.h" |
28 | 29 |
29 namespace content { | 30 namespace content { |
30 class KeyboardListener; | 31 class KeyboardListener; |
31 } | 32 } |
32 | 33 |
33 namespace gfx { | 34 namespace gfx { |
34 class Image; | 35 class Image; |
35 } | 36 } |
36 | 37 |
37 namespace views { | 38 namespace views { |
38 class Checkbox; | 39 class Checkbox; |
39 class Combobox; | 40 class Combobox; |
40 class FocusableBorder; | 41 class FocusableBorder; |
41 class FocusManager; | 42 class FocusManager; |
42 class ImageButton; | 43 class ImageButton; |
43 class ImageView; | 44 class ImageView; |
44 class Label; | 45 class Label; |
| 46 class LabelButton; |
45 class Link; | 47 class Link; |
46 class MenuRunner; | 48 class MenuRunner; |
47 class StyledLabel; | 49 class StyledLabel; |
48 class WebView; | 50 class WebView; |
49 class Widget; | 51 class Widget; |
50 } // namespace views | 52 } // namespace views |
51 | 53 |
52 namespace ui { | 54 namespace ui { |
53 class ComboboxModel; | 55 class ComboboxModel; |
54 class KeyEvent; | 56 class KeyEvent; |
| 57 class MultiAnimation; |
55 } | 58 } |
56 | 59 |
57 namespace autofill { | 60 namespace autofill { |
58 | 61 |
59 class AutofillDialogSignInDelegate; | 62 class AutofillDialogSignInDelegate; |
60 struct DetailInput; | 63 struct DetailInput; |
61 | 64 |
62 // Views toolkit implementation of the Autofill dialog that handles the | 65 // Views toolkit implementation of the Autofill dialog that handles the |
63 // imperative autocomplete API call. | 66 // imperative autocomplete API call. |
64 class AutofillDialogViews : public AutofillDialogView, | 67 class AutofillDialogViews : public AutofillDialogView, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 268 |
266 // The controller |this| queries for logic and state. | 269 // The controller |this| queries for logic and state. |
267 AutofillDialogController* controller_; | 270 AutofillDialogController* controller_; |
268 | 271 |
269 // Runs the suggestion menu (triggered by each section's |suggested_button|. | 272 // Runs the suggestion menu (triggered by each section's |suggested_button|. |
270 scoped_ptr<views::MenuRunner> menu_runner_; | 273 scoped_ptr<views::MenuRunner> menu_runner_; |
271 | 274 |
272 DISALLOW_COPY_AND_ASSIGN(AccountChooser); | 275 DISALLOW_COPY_AND_ASSIGN(AccountChooser); |
273 }; | 276 }; |
274 | 277 |
| 278 // A view which displays an image, optionally some messages and a button. Used |
| 279 // for the splash page as well as the Wallet interstitial. |
| 280 class OverlayView : public views::View, |
| 281 public ui::AnimationDelegate { |
| 282 public: |
| 283 // The listener is informed when |button_| is pressed. |
| 284 explicit OverlayView(views::ButtonListener* listener); |
| 285 virtual ~OverlayView(); |
| 286 |
| 287 // Sets properties that should be displayed. |
| 288 void SetState(const DialogOverlayState& state, |
| 289 views::ButtonListener* listener); |
| 290 |
| 291 // Fades the view out after a delay. |
| 292 void BeginFadeOut(); |
| 293 |
| 294 // ui::AnimationDelegate implementation: |
| 295 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 296 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
| 297 |
| 298 // views::View implementation: |
| 299 virtual void Layout() OVERRIDE; |
| 300 virtual const char* GetClassName() const OVERRIDE; |
| 301 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 302 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 303 |
| 304 private: |
| 305 // Child View. Front and center. |
| 306 views::ImageView* image_view_; |
| 307 // Child View. When visible, below |image_view_|. |
| 308 views::View* message_stack_; |
| 309 // Child View. When visible, below |message_stack_|. |
| 310 views::LabelButton* button_; |
| 311 |
| 312 // This MultiAnimation is used to first fade out the contents of the |
| 313 // overlay, then fade out the background of the overlay (revealing the |
| 314 // dialog behind the overlay). This avoids cross-fade. |
| 315 scoped_ptr<ui::MultiAnimation> fade_out_; |
| 316 |
| 317 DISALLOW_COPY_AND_ASSIGN(OverlayView); |
| 318 }; |
| 319 |
275 // An area for notifications. Some notifications point at the account chooser. | 320 // An area for notifications. Some notifications point at the account chooser. |
276 class NotificationArea : public views::View, | 321 class NotificationArea : public views::View, |
277 public views::ButtonListener { | 322 public views::ButtonListener { |
278 public: | 323 public: |
279 explicit NotificationArea(AutofillDialogController* controller); | 324 explicit NotificationArea(AutofillDialogController* controller); |
280 virtual ~NotificationArea(); | 325 virtual ~NotificationArea(); |
281 | 326 |
282 // Displays the given notifications. | 327 // Displays the given notifications. |
283 void SetNotifications(const std::vector<DialogNotification>& notifications); | 328 void SetNotifications(const std::vector<DialogNotification>& notifications); |
284 | 329 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 // View that wraps |details_container_| and makes it scroll vertically. | 603 // View that wraps |details_container_| and makes it scroll vertically. |
559 views::ScrollView* scrollable_area_; | 604 views::ScrollView* scrollable_area_; |
560 | 605 |
561 // View to host details sections. | 606 // View to host details sections. |
562 views::View* details_container_; | 607 views::View* details_container_; |
563 | 608 |
564 // A view that overlays |this| (for "loading..." messages). | 609 // A view that overlays |this| (for "loading..." messages). |
565 views::Label* loading_shield_; | 610 views::Label* loading_shield_; |
566 | 611 |
567 // The view that completely overlays the dialog (used for the splash page). | 612 // The view that completely overlays the dialog (used for the splash page). |
568 views::View* overlay_view_; | 613 OverlayView* overlay_view_; |
569 | 614 |
570 // The "Extra view" is on the same row as the dialog buttons. | 615 // The "Extra view" is on the same row as the dialog buttons. |
571 views::View* button_strip_extra_view_; | 616 views::View* button_strip_extra_view_; |
572 | 617 |
573 // This checkbox controls whether new details are saved to the Autofill | 618 // This checkbox controls whether new details are saved to the Autofill |
574 // database. It lives in |extra_view_|. | 619 // database. It lives in |extra_view_|. |
575 views::Checkbox* save_in_chrome_checkbox_; | 620 views::Checkbox* save_in_chrome_checkbox_; |
576 | 621 |
577 // View to host Autocheckout steps. | 622 // View to host Autocheckout steps. |
578 AutocheckoutStepsArea* autocheckout_steps_area_; | 623 AutocheckoutStepsArea* autocheckout_steps_area_; |
(...skipping 24 matching lines...) Expand all Loading... |
603 | 648 |
604 // Delegate for the sign-in dialog's webview. | 649 // Delegate for the sign-in dialog's webview. |
605 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; | 650 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; |
606 | 651 |
607 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 652 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
608 }; | 653 }; |
609 | 654 |
610 } // namespace autofill | 655 } // namespace autofill |
611 | 656 |
612 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 657 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
OLD | NEW |