OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 7 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
8 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" | 8 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" |
9 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | 9 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" |
10 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" | 10 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 base::TimeDelta::FromSeconds(1)); | 72 base::TimeDelta::FromSeconds(1)); |
73 } else { | 73 } else { |
74 SetInputsEnabled(true); | 74 SetInputsEnabled(true); |
75 cvc_input_->SetInvalid(true); | 75 cvc_input_->SetInvalid(true); |
76 message_label_->SetText(base::ASCIIToUTF16("Verification error.")); | 76 message_label_->SetText(base::ASCIIToUTF16("Verification error.")); |
77 GetDialogClientView()->UpdateDialogButtons(); | 77 GetDialogClientView()->UpdateDialogButtons(); |
78 } | 78 } |
79 Layout(); | 79 Layout(); |
80 } | 80 } |
81 | 81 |
| 82 void CancelForTesting() override { |
| 83 if (Cancel()) |
| 84 ClosePrompt(); |
| 85 } |
| 86 |
82 void SetInputsEnabled(bool enabled) { | 87 void SetInputsEnabled(bool enabled) { |
83 cvc_input_->SetEnabled(enabled); | 88 cvc_input_->SetEnabled(enabled); |
84 | 89 |
85 if (month_input_) | 90 if (month_input_) |
86 month_input_->SetEnabled(enabled); | 91 month_input_->SetEnabled(enabled); |
87 if (year_input_) | 92 if (year_input_) |
88 year_input_->SetEnabled(enabled); | 93 year_input_->SetEnabled(enabled); |
89 } | 94 } |
90 | 95 |
91 // views::DialogDelegateView | 96 // views::DialogDelegateView |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 249 |
245 // static | 250 // static |
246 CardUnmaskPromptView* CardUnmaskPromptView::CreateAndShow( | 251 CardUnmaskPromptView* CardUnmaskPromptView::CreateAndShow( |
247 CardUnmaskPromptController* controller) { | 252 CardUnmaskPromptController* controller) { |
248 CardUnmaskPromptViews* view = new CardUnmaskPromptViews(controller); | 253 CardUnmaskPromptViews* view = new CardUnmaskPromptViews(controller); |
249 view->Show(); | 254 view->Show(); |
250 return view; | 255 return view; |
251 } | 256 } |
252 | 257 |
253 } // namespace autofill | 258 } // namespace autofill |
OLD | NEW |