| 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/link_listener.h" | 13 #include "ui/views/controls/link_listener.h" |
| 14 #include "ui/views/controls/textfield/textfield_controller.h" | 14 #include "ui/views/controls/textfield/textfield_controller.h" |
| 15 #include "ui/views/window/dialog_delegate.h" | 15 #include "ui/views/window/dialog_delegate.h" |
| 16 | 16 |
| 17 namespace content { |
| 18 class WebContents; |
| 19 } |
| 20 |
| 17 namespace views { | 21 namespace views { |
| 18 class Checkbox; | 22 class Checkbox; |
| 19 class ImageView; | 23 class ImageView; |
| 20 class Label; | 24 class Label; |
| 21 class Link; | 25 class Link; |
| 22 class Throbber; | 26 class Throbber; |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace autofill { | 29 namespace autofill { |
| 26 | 30 |
| 27 class DecoratedTextfield; | 31 class DecoratedTextfield; |
| 28 | 32 |
| 29 class CardUnmaskPromptViews : public CardUnmaskPromptView, | 33 class CardUnmaskPromptViews : public CardUnmaskPromptView, |
| 30 views::ComboboxListener, | 34 views::ComboboxListener, |
| 31 views::DialogDelegateView, | 35 views::DialogDelegateView, |
| 32 views::TextfieldController, | 36 views::TextfieldController, |
| 33 views::LinkListener, | 37 views::LinkListener, |
| 34 gfx::AnimationDelegate { | 38 gfx::AnimationDelegate { |
| 35 public: | 39 public: |
| 36 explicit CardUnmaskPromptViews(CardUnmaskPromptController* controller); | 40 CardUnmaskPromptViews(CardUnmaskPromptController* controller, |
| 37 | 41 content::WebContents* web_contents); |
| 38 ~CardUnmaskPromptViews() override; | 42 ~CardUnmaskPromptViews() override; |
| 39 | 43 |
| 40 void Show(); | |
| 41 | |
| 42 // CardUnmaskPromptView | 44 // CardUnmaskPromptView |
| 45 void Show() override; |
| 43 void ControllerGone() override; | 46 void ControllerGone() override; |
| 44 void DisableAndWaitForVerification() override; | 47 void DisableAndWaitForVerification() override; |
| 45 void GotVerificationResult(const base::string16& error_message, | 48 void GotVerificationResult(const base::string16& error_message, |
| 46 bool allow_retry) override; | 49 bool allow_retry) override; |
| 47 | 50 |
| 48 // views::DialogDelegateView | 51 // views::DialogDelegateView |
| 49 View* GetContentsView() override; | 52 View* GetContentsView() override; |
| 50 views::View* CreateFootnoteView() override; | 53 views::View* CreateFootnoteView() override; |
| 51 | 54 |
| 52 // views::View | 55 // views::View |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 void InitIfNecessary(); | 115 void InitIfNecessary(); |
| 113 void SetRetriableErrorMessage(const base::string16& message); | 116 void SetRetriableErrorMessage(const base::string16& message); |
| 114 bool ExpirationDateIsValid() const; | 117 bool ExpirationDateIsValid() const; |
| 115 void SetInputsEnabled(bool enabled); | 118 void SetInputsEnabled(bool enabled); |
| 116 void ShowNewCardLink(); | 119 void ShowNewCardLink(); |
| 117 void ClosePrompt(); | 120 void ClosePrompt(); |
| 118 | 121 |
| 119 CardUnmaskPromptController* controller_; | 122 CardUnmaskPromptController* controller_; |
| 123 content::WebContents* web_contents_; |
| 120 | 124 |
| 121 views::View* main_contents_; | 125 views::View* main_contents_; |
| 122 | 126 |
| 123 // The error label for permanent errors (where the user can't retry). | 127 // The error label for permanent errors (where the user can't retry). |
| 124 views::Label* permanent_error_label_; | 128 views::Label* permanent_error_label_; |
| 125 | 129 |
| 126 // Holds the cvc and expiration inputs. | 130 // Holds the cvc and expiration inputs. |
| 127 views::View* input_row_; | 131 views::View* input_row_; |
| 128 | 132 |
| 129 DecoratedTextfield* cvc_input_; | 133 DecoratedTextfield* cvc_input_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 150 gfx::SlideAnimation overlay_animation_; | 154 gfx::SlideAnimation overlay_animation_; |
| 151 | 155 |
| 152 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; | 156 base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_; |
| 153 | 157 |
| 154 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); | 158 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); |
| 155 }; | 159 }; |
| 156 | 160 |
| 157 } // namespace autofill | 161 } // namespace autofill |
| 158 | 162 |
| 159 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ | 163 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_CARD_UNMASK_PROMPT_VIEWS_H_ |
| OLD | NEW |