| 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 "chrome/browser/ui/views/autofill/card_unmask_prompt_views.h" | 5 #include "chrome/browser/ui/views/autofill/card_unmask_prompt_views.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 295 } |
| 296 | 296 |
| 297 base::string16 CardUnmaskPromptViews::GetDialogButtonLabel( | 297 base::string16 CardUnmaskPromptViews::GetDialogButtonLabel( |
| 298 ui::DialogButton button) const { | 298 ui::DialogButton button) const { |
| 299 if (button == ui::DIALOG_BUTTON_OK) | 299 if (button == ui::DIALOG_BUTTON_OK) |
| 300 return controller_->GetOkButtonLabel(); | 300 return controller_->GetOkButtonLabel(); |
| 301 | 301 |
| 302 return DialogDelegateView::GetDialogButtonLabel(button); | 302 return DialogDelegateView::GetDialogButtonLabel(button); |
| 303 } | 303 } |
| 304 | 304 |
| 305 bool CardUnmaskPromptViews::ShouldDefaultButtonBeBlue() const { | |
| 306 return true; | |
| 307 } | |
| 308 | |
| 309 bool CardUnmaskPromptViews::IsDialogButtonEnabled( | 305 bool CardUnmaskPromptViews::IsDialogButtonEnabled( |
| 310 ui::DialogButton button) const { | 306 ui::DialogButton button) const { |
| 311 if (button == ui::DIALOG_BUTTON_CANCEL) | 307 if (button == ui::DIALOG_BUTTON_CANCEL) |
| 312 return true; | 308 return true; |
| 313 | 309 |
| 314 DCHECK_EQ(ui::DIALOG_BUTTON_OK, button); | 310 DCHECK_EQ(ui::DIALOG_BUTTON_OK, button); |
| 315 | 311 |
| 316 return cvc_input_->enabled() && | 312 return cvc_input_->enabled() && |
| 317 controller_->InputCvcIsValid(cvc_input_->text()) && | 313 controller_->InputCvcIsValid(cvc_input_->text()) && |
| 318 ExpirationDateIsValid(); | 314 ExpirationDateIsValid(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 views::View::OnPaint(canvas); | 519 views::View::OnPaint(canvas); |
| 524 canvas->Restore(); | 520 canvas->Restore(); |
| 525 } | 521 } |
| 526 | 522 |
| 527 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { | 523 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { |
| 528 alpha_ = alpha; | 524 alpha_ = alpha; |
| 529 SchedulePaint(); | 525 SchedulePaint(); |
| 530 } | 526 } |
| 531 | 527 |
| 532 } // namespace autofill | 528 } // namespace autofill |
| OLD | NEW |