Chromium Code Reviews| 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/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 503 } | 503 } |
| 504 | 504 |
| 505 CardUnmaskPromptViews::FadeOutView::FadeOutView() | 505 CardUnmaskPromptViews::FadeOutView::FadeOutView() |
| 506 : fade_everything_(false), alpha_(255) { | 506 : fade_everything_(false), alpha_(255) { |
| 507 } | 507 } |
| 508 CardUnmaskPromptViews::FadeOutView::~FadeOutView() { | 508 CardUnmaskPromptViews::FadeOutView::~FadeOutView() { |
| 509 } | 509 } |
| 510 | 510 |
| 511 void CardUnmaskPromptViews::FadeOutView::PaintChildren( | 511 void CardUnmaskPromptViews::FadeOutView::PaintChildren( |
| 512 const ui::PaintContext& context) { | 512 const ui::PaintContext& context) { |
| 513 ui::CompositingRecorder recorder(context, size(), alpha_); | 513 ui::CompositingRecorder recorder(context, size(), alpha_, false); |
|
danakj
2015/12/11 19:07:00
I'd appreciate a named temp var for this as well,
| |
| 514 views::View::PaintChildren(context); | 514 views::View::PaintChildren(context); |
| 515 } | 515 } |
| 516 | 516 |
| 517 void CardUnmaskPromptViews::FadeOutView::OnPaint(gfx::Canvas* canvas) { | 517 void CardUnmaskPromptViews::FadeOutView::OnPaint(gfx::Canvas* canvas) { |
| 518 if (!fade_everything_ || alpha_ == 255) | 518 if (!fade_everything_ || alpha_ == 255) |
| 519 return views::View::OnPaint(canvas); | 519 return views::View::OnPaint(canvas); |
| 520 | 520 |
| 521 canvas->SaveLayerAlpha(alpha_); | 521 canvas->SaveLayerAlpha(alpha_); |
| 522 views::View::OnPaint(canvas); | 522 views::View::OnPaint(canvas); |
| 523 canvas->Restore(); | 523 canvas->Restore(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { | 526 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { |
| 527 alpha_ = alpha; | 527 alpha_ = alpha; |
| 528 SchedulePaint(); | 528 SchedulePaint(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 } // namespace autofill | 531 } // namespace autofill |
| OLD | NEW |