| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/infobars/translate_infobar_base.h" | 5 #include "chrome/browser/ui/views/infobars/translate_infobar_base.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/infobars/infobar.h" | 8 #include "chrome/browser/infobars/infobar.h" |
| 9 #include "chrome/browser/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/browser/translate/translate_infobar_delegate.h" | 10 #include "chrome/browser/translate/translate_infobar_delegate.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const views::Background& TranslateInfoBarBase::GetBackground() { | 109 const views::Background& TranslateInfoBarBase::GetBackground() { |
| 110 return GetDelegate()->IsError() ? error_background_ : *background(); | 110 return GetDelegate()->IsError() ? error_background_ : *background(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas, | 113 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas, |
| 114 double animation_value, | 114 double animation_value, |
| 115 const views::Background& background) { | 115 const views::Background& background) { |
| 116 // Draw the background into an offscreen buffer with alpha value per animation | 116 // Draw the background into an offscreen buffer with alpha value per animation |
| 117 // value, then blend it back into the current canvas. | 117 // value, then blend it back into the current canvas. |
| 118 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255)); | 118 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255)); |
| 119 canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); | |
| 120 background.Paint(canvas, this); | 119 background.Paint(canvas, this); |
| 121 canvas->Restore(); | 120 canvas->Restore(); |
| 122 } | 121 } |
| OLD | NEW |