OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CARD_UNMASK_PROMPT_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ |
7 | 7 |
8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
9 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | 9 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" |
10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
11 #include "ui/gfx/animation/slide_animation.h" | 11 #include "ui/gfx/animation/slide_animation.h" |
12 #include "ui/views/controls/combobox/combobox_listener.h" | 12 #include "ui/views/controls/combobox/combobox_listener.h" |
13 #include "ui/views/controls/textfield/textfield_controller.h" | 13 #include "ui/views/controls/textfield/textfield_controller.h" |
14 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
15 | 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 19 |
16 namespace views { | 20 namespace views { |
17 class Checkbox; | 21 class Checkbox; |
18 class ImageView; | 22 class ImageView; |
19 class Label; | 23 class Label; |
20 class Throbber; | 24 class Throbber; |
21 } | 25 } |
22 | 26 |
23 namespace autofill { | 27 namespace autofill { |
24 | 28 |
25 class DecoratedTextfield; | 29 class DecoratedTextfield; |
26 | 30 |
27 class CardUnmaskPromptViews : public CardUnmaskPromptView, | 31 class CardUnmaskPromptViews : public CardUnmaskPromptView, |
28 views::ComboboxListener, | 32 views::ComboboxListener, |
29 views::DialogDelegateView, | 33 views::DialogDelegateView, |
30 views::TextfieldController, | 34 views::TextfieldController, |
31 gfx::AnimationDelegate { | 35 gfx::AnimationDelegate { |
32 public: | 36 public: |
33 explicit CardUnmaskPromptViews(CardUnmaskPromptController* controller); | 37 CardUnmaskPromptViews(CardUnmaskPromptController* controller, |
34 | 38 content::WebContents* web_contents); |
35 ~CardUnmaskPromptViews() override; | 39 ~CardUnmaskPromptViews() override; |
36 | 40 |
37 void Show(); | |
38 | |
39 // CardUnmaskPromptView | 41 // CardUnmaskPromptView |
| 42 void Show() override; |
40 void ControllerGone() override; | 43 void ControllerGone() override; |
41 void DisableAndWaitForVerification() override; | 44 void DisableAndWaitForVerification() override; |
42 void GotVerificationResult(const base::string16& error_message, | 45 void GotVerificationResult(const base::string16& error_message, |
43 bool allow_retry) override; | 46 bool allow_retry) override; |
44 | 47 |
45 // views::DialogDelegateView | 48 // views::DialogDelegateView |
46 View* GetContentsView() override; | 49 View* GetContentsView() override; |
47 views::View* CreateFootnoteView() override; | 50 views::View* CreateFootnoteView() override; |
48 | 51 |
49 // views::View | 52 // views::View |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DISALLOW_COPY_AND_ASSIGN(FadeOutView); | 105 DISALLOW_COPY_AND_ASSIGN(FadeOutView); |
103 }; | 106 }; |
104 | 107 |
105 void InitIfNecessary(); | 108 void InitIfNecessary(); |
106 void SetRetriableErrorMessage(const base::string16& message); | 109 void SetRetriableErrorMessage(const base::string16& message); |
107 bool ExpirationDateIsValid() const; | 110 bool ExpirationDateIsValid() const; |
108 void SetInputsEnabled(bool enabled); | 111 void SetInputsEnabled(bool enabled); |
109 void ClosePrompt(); | 112 void ClosePrompt(); |
110 | 113 |
111 CardUnmaskPromptController* controller_; | 114 CardUnmaskPromptController* controller_; |
| 115 content::WebContents* web_contents_; |
112 | 116 |
113 views::View* main_contents_; | 117 views::View* main_contents_; |
114 | 118 |
115 // The error label for permanent errors (where the user can't retry). | 119 // The error label for permanent errors (where the user can't retry). |
116 views::Label* permanent_error_label_; | 120 views::Label* permanent_error_label_; |
117 | 121 |
118 // Holds the cvc and expiration inputs. | 122 // Holds the cvc and expiration inputs. |
119 views::View* input_row_; | 123 views::View* input_row_; |
120 | 124 |
121 DecoratedTextfield* cvc_input_; | 125 DecoratedTextfield* cvc_input_; |
(...skipping 19 matching lines...) Expand all Loading... |
141 gfx::SlideAnimation overlay_animation_; | 145 gfx::SlideAnimation overlay_animation_; |
142 | 146 |
143 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; | 147 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; |
144 | 148 |
145 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); | 149 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); |
146 }; | 150 }; |
147 | 151 |
148 } // namespace autofill | 152 } // namespace autofill |
149 | 153 |
150 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ | 154 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ |
OLD | NEW |