| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 IDS_AUTOFILL_CARD_UNMASK_INVALID_EXPIRATION_DATE)); | 321 IDS_AUTOFILL_CARD_UNMASK_INVALID_EXPIRATION_DATE)); |
| 322 } | 322 } |
| 323 | 323 |
| 324 GetDialogClientView()->UpdateDialogButtons(); | 324 GetDialogClientView()->UpdateDialogButtons(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void CardUnmaskPromptViews::AnimationProgressed( | 327 void CardUnmaskPromptViews::AnimationProgressed( |
| 328 const gfx::Animation* animation) { | 328 const gfx::Animation* animation) { |
| 329 uint8_t alpha = static_cast<uint8_t>(animation->CurrentValueBetween(0, 255)); | 329 uint8_t alpha = static_cast<uint8_t>(animation->CurrentValueBetween(0, 255)); |
| 330 progress_overlay_->SetAlpha(alpha); | 330 progress_overlay_->SetAlpha(alpha); |
| 331 storage_row_->SetAlpha(255 - alpha); | 331 if (storage_row_) |
| 332 storage_row_->SetAlpha(255 - alpha); |
| 332 } | 333 } |
| 333 | 334 |
| 334 void CardUnmaskPromptViews::InitIfNecessary() { | 335 void CardUnmaskPromptViews::InitIfNecessary() { |
| 335 if (has_children()) | 336 if (has_children()) |
| 336 return; | 337 return; |
| 337 | 338 |
| 338 main_contents_ = new views::View(); | 339 main_contents_ = new views::View(); |
| 339 main_contents_->SetLayoutManager( | 340 main_contents_->SetLayoutManager( |
| 340 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 12)); | 341 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 12)); |
| 341 AddChildView(main_contents_); | 342 AddChildView(main_contents_); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 views::View::OnPaint(canvas); | 477 views::View::OnPaint(canvas); |
| 477 canvas->Restore(); | 478 canvas->Restore(); |
| 478 } | 479 } |
| 479 | 480 |
| 480 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { | 481 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { |
| 481 alpha_ = alpha; | 482 alpha_ = alpha; |
| 482 SchedulePaint(); | 483 SchedulePaint(); |
| 483 } | 484 } |
| 484 | 485 |
| 485 } // namespace autofill | 486 } // namespace autofill |
| OLD | NEW |