Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: chrome/browser/ui/views/infobars/translate_infobar_base.cc

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more two win fixes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/translate/translate_infobar_delegate.h" 8 #include "chrome/browser/translate/translate_infobar_delegate.h"
9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h" 9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h"
10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h" 10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h"
11 #include "chrome/browser/ui/views/infobars/translate_message_infobar.h" 11 #include "chrome/browser/ui/views/infobars/translate_message_infobar.h"
12 #include "grit/theme_resources.h" 12 #include "grit/theme_resources.h"
13 #include "ui/base/animation/slide_animation.h" 13 #include "ui/base/animation/slide_animation.h"
14 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/canvas_skia.h" 15 #include "ui/gfx/canvas.h"
16 #include "ui/views/controls/button/menu_button.h" 16 #include "ui/views/controls/button/menu_button.h"
17 #include "ui/views/controls/label.h" 17 #include "ui/views/controls/label.h"
18 18
19 // TranslateInfoBarDelegate --------------------------------------------------- 19 // TranslateInfoBarDelegate ---------------------------------------------------
20 20
21 InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { 21 InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) {
22 TranslateInfoBarBase* infobar = NULL; 22 TranslateInfoBarBase* infobar = NULL;
23 switch (type_) { 23 switch (type_) {
24 case BEFORE_TRANSLATE: 24 case BEFORE_TRANSLATE:
25 infobar = new BeforeTranslateInfoBar(owner, this); 25 infobar = new BeforeTranslateInfoBar(owner, this);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas, 126 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas,
127 double animation_value, 127 double animation_value,
128 const views::Background& background) { 128 const views::Background& background) {
129 // Draw the background into an offscreen buffer with alpha value per animation 129 // Draw the background into an offscreen buffer with alpha value per animation
130 // value, then blend it back into the current canvas. 130 // value, then blend it back into the current canvas.
131 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255)); 131 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255));
132 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 132 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
133 background.Paint(canvas, this); 133 background.Paint(canvas, this);
134 canvas->Restore(); 134 canvas->Restore();
135 } 135 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698