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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
10 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" | 10 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_SUCCESS)); | 102 IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_SUCCESS)); |
103 progress_throbber_->SetChecked(true); | 103 progress_throbber_->SetChecked(true); |
104 base::MessageLoop::current()->PostDelayedTask( | 104 base::MessageLoop::current()->PostDelayedTask( |
105 FROM_HERE, base::Bind(&CardUnmaskPromptViews::ClosePrompt, | 105 FROM_HERE, base::Bind(&CardUnmaskPromptViews::ClosePrompt, |
106 weak_ptr_factory_.GetWeakPtr()), | 106 weak_ptr_factory_.GetWeakPtr()), |
107 controller_->GetSuccessMessageDuration()); | 107 controller_->GetSuccessMessageDuration()); |
108 } else { | 108 } else { |
109 // TODO(estade): it's somewhat jarring when the error comes back too | 109 // TODO(estade): it's somewhat jarring when the error comes back too |
110 // quickly. | 110 // quickly. |
111 overlay_animation_.Reset(); | 111 overlay_animation_.Reset(); |
112 storage_row_->SetAlpha(255); | 112 if (storage_row_) |
| 113 storage_row_->SetAlpha(255); |
113 progress_overlay_->SetVisible(false); | 114 progress_overlay_->SetVisible(false); |
114 | 115 |
115 if (allow_retry) { | 116 if (allow_retry) { |
116 SetInputsEnabled(true); | 117 SetInputsEnabled(true); |
117 | 118 |
118 // If there is more than one input showing, don't mark anything as | 119 // If there is more than one input showing, don't mark anything as |
119 // invalid since we don't know the location of the problem. | 120 // invalid since we don't know the location of the problem. |
120 if (!controller_->ShouldRequestExpirationDate()) | 121 if (!controller_->ShouldRequestExpirationDate()) |
121 cvc_input_->SetInvalid(true); | 122 cvc_input_->SetInvalid(true); |
122 | 123 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 views::View::OnPaint(canvas); | 478 views::View::OnPaint(canvas); |
478 canvas->Restore(); | 479 canvas->Restore(); |
479 } | 480 } |
480 | 481 |
481 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { | 482 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { |
482 alpha_ = alpha; | 483 alpha_ = alpha; |
483 SchedulePaint(); | 484 SchedulePaint(); |
484 } | 485 } |
485 | 486 |
486 } // namespace autofill | 487 } // namespace autofill |
OLD | NEW |