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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class Label; | 27 class Label; |
28 class Link; | 28 class Link; |
29 class Throbber; | 29 class Throbber; |
30 } | 30 } |
31 | 31 |
32 namespace autofill { | 32 namespace autofill { |
33 | 33 |
34 class DecoratedTextfield; | 34 class DecoratedTextfield; |
35 | 35 |
36 class CardUnmaskPromptViews : public CardUnmaskPromptView, | 36 class CardUnmaskPromptViews : public CardUnmaskPromptView, |
37 views::ComboboxListener, | 37 public views::ComboboxListener, |
38 views::DialogDelegateView, | 38 public views::DialogDelegateView, |
39 views::TextfieldController, | 39 public views::TextfieldController, |
40 views::LinkListener, | 40 public views::LinkListener, |
41 gfx::AnimationDelegate { | 41 public gfx::AnimationDelegate { |
42 public: | 42 public: |
43 CardUnmaskPromptViews(CardUnmaskPromptController* controller, | 43 CardUnmaskPromptViews(CardUnmaskPromptController* controller, |
44 content::WebContents* web_contents); | 44 content::WebContents* web_contents); |
45 ~CardUnmaskPromptViews() override; | 45 ~CardUnmaskPromptViews() override; |
46 | 46 |
47 // CardUnmaskPromptView | 47 // CardUnmaskPromptView |
48 void Show() override; | 48 void Show() override; |
49 void ControllerGone() override; | 49 void ControllerGone() override; |
50 void DisableAndWaitForVerification() override; | 50 void DisableAndWaitForVerification() override; |
51 void GotVerificationResult(const base::string16& error_message, | 51 void GotVerificationResult(const base::string16& error_message, |
52 bool allow_retry) override; | 52 bool allow_retry) override; |
53 | 53 |
54 // views::DialogDelegateView | 54 // views::DialogDelegateView |
55 View* GetContentsView() override; | 55 View* GetContentsView() override; |
56 views::View* CreateFootnoteView() override; | 56 View* CreateFootnoteView() override; |
57 | 57 |
58 // views::View | 58 // views::View |
59 gfx::Size GetPreferredSize() const override; | 59 gfx::Size GetPreferredSize() const override; |
60 void Layout() override; | 60 void Layout() override; |
61 int GetHeightForWidth(int width) const override; | 61 int GetHeightForWidth(int width) const override; |
62 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 62 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
63 ui::ModalType GetModalType() const override; | 63 ui::ModalType GetModalType() const override; |
64 base::string16 GetWindowTitle() const override; | 64 base::string16 GetWindowTitle() const override; |
65 void DeleteDelegate() override; | 65 void DeleteDelegate() override; |
66 int GetDialogButtons() const override; | |
67 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 66 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
68 bool ShouldDefaultButtonBeBlue() const override; | 67 bool ShouldDefaultButtonBeBlue() const override; |
69 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 68 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
70 views::View* GetInitiallyFocusedView() override; | 69 View* GetInitiallyFocusedView() override; |
71 bool Cancel() override; | 70 bool Cancel() override; |
72 bool Accept() override; | 71 bool Accept() override; |
73 | 72 |
74 // views::TextfieldController | 73 // views::TextfieldController |
75 void ContentsChanged(views::Textfield* sender, | 74 void ContentsChanged(views::Textfield* sender, |
76 const base::string16& new_contents) override; | 75 const base::string16& new_contents) override; |
77 | 76 |
78 // views::ComboboxListener | 77 // views::ComboboxListener |
79 void OnPerformAction(views::Combobox* combobox) override; | 78 void OnPerformAction(views::Combobox* combobox) override; |
80 | 79 |
81 // views::LinkListener | 80 // views::LinkListener |
82 void LinkClicked(views::Link* source, int event_flags) override; | 81 void LinkClicked(views::Link* source, int event_flags) override; |
83 | 82 |
84 // gfx::AnimationDelegate | 83 // gfx::AnimationDelegate |
85 void AnimationProgressed(const gfx::Animation* animation) override; | 84 void AnimationProgressed(const gfx::Animation* animation) override; |
86 | 85 |
87 private: | 86 private: |
88 friend class CardUnmaskPromptViewTesterViews; | 87 friend class CardUnmaskPromptViewTesterViews; |
89 | 88 |
90 // A view that allows changing the opacity of its contents. | 89 // A view that allows changing the opacity of its contents. |
91 class FadeOutView : public views::View { | 90 class FadeOutView : public View { |
92 public: | 91 public: |
93 FadeOutView(); | 92 FadeOutView(); |
94 ~FadeOutView() override; | 93 ~FadeOutView() override; |
95 | 94 |
96 // views::View | 95 // views::View |
97 void PaintChildren(const ui::PaintContext& context) override; | 96 void PaintChildren(const ui::PaintContext& context) override; |
98 void OnPaint(gfx::Canvas* canvas) override; | 97 void OnPaint(gfx::Canvas* canvas) override; |
99 | 98 |
100 void set_fade_everything(bool fade_everything) { | 99 void set_fade_everything(bool fade_everything) { |
101 fade_everything_ = fade_everything; | 100 fade_everything_ = fade_everything; |
(...skipping 16 matching lines...) Expand all Loading... |
118 void InitIfNecessary(); | 117 void InitIfNecessary(); |
119 void SetRetriableErrorMessage(const base::string16& message); | 118 void SetRetriableErrorMessage(const base::string16& message); |
120 bool ExpirationDateIsValid() const; | 119 bool ExpirationDateIsValid() const; |
121 void SetInputsEnabled(bool enabled); | 120 void SetInputsEnabled(bool enabled); |
122 void ShowNewCardLink(); | 121 void ShowNewCardLink(); |
123 void ClosePrompt(); | 122 void ClosePrompt(); |
124 | 123 |
125 CardUnmaskPromptController* controller_; | 124 CardUnmaskPromptController* controller_; |
126 content::WebContents* web_contents_; | 125 content::WebContents* web_contents_; |
127 | 126 |
128 views::View* main_contents_; | 127 View* main_contents_; |
129 | 128 |
130 // Expository language at the top of the dialog. | 129 // Expository language at the top of the dialog. |
131 views::Label* instructions_; | 130 views::Label* instructions_; |
132 | 131 |
133 // The error label for permanent errors (where the user can't retry). | 132 // The error label for permanent errors (where the user can't retry). |
134 views::Label* permanent_error_label_; | 133 views::Label* permanent_error_label_; |
135 | 134 |
136 // Holds the cvc and expiration inputs. | 135 // Holds the cvc and expiration inputs. |
137 views::View* input_row_; | 136 View* input_row_; |
138 | 137 |
139 DecoratedTextfield* cvc_input_; | 138 DecoratedTextfield* cvc_input_; |
140 | 139 |
141 views::Combobox* month_input_; | 140 views::Combobox* month_input_; |
142 views::Combobox* year_input_; | 141 views::Combobox* year_input_; |
143 | 142 |
144 MonthComboboxModel month_combobox_model_; | 143 MonthComboboxModel month_combobox_model_; |
145 YearComboboxModel year_combobox_model_; | 144 YearComboboxModel year_combobox_model_; |
146 | 145 |
147 views::Link* new_card_link_; | 146 views::Link* new_card_link_; |
(...skipping 12 matching lines...) Expand all Loading... |
160 gfx::SlideAnimation overlay_animation_; | 159 gfx::SlideAnimation overlay_animation_; |
161 | 160 |
162 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; | 161 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; |
163 | 162 |
164 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); | 163 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); |
165 }; | 164 }; |
166 | 165 |
167 } // namespace autofill | 166 } // namespace autofill |
168 | 167 |
169 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ | 168 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ |
OLD | NEW |