Index: chrome/browser/views/browser_actions_container.cc |
=================================================================== |
--- chrome/browser/views/browser_actions_container.cc (revision 50452) |
+++ chrome/browser/views/browser_actions_container.cc (working copy) |
@@ -31,6 +31,7 @@ |
#include "chrome/common/notification_type.h" |
#include "chrome/common/pref_names.h" |
#include "gfx/canvas.h" |
+#include "gfx/canvas_skia.h" |
#include "grit/app_resources.h" |
#include "grit/generated_resources.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -315,20 +316,22 @@ |
button_->Destroy(); |
} |
-gfx::Canvas* BrowserActionView::GetIconWithBadge() { |
+gfx::CanvasSkia* BrowserActionView::GetIconWithBadge() { |
int tab_id = panel_->GetCurrentTabId(); |
SkBitmap icon = button_->extension()->browser_action()->GetIcon(tab_id); |
if (icon.isNull()) |
icon = button_->default_icon(); |
- gfx::Canvas* canvas = new gfx::Canvas(icon.width(), icon.height(), false); |
+ gfx::CanvasSkia* canvas = |
+ new gfx::CanvasSkia(icon.width(), icon.height(), false); |
canvas->DrawBitmapInt(icon, 0, 0); |
if (tab_id >= 0) { |
gfx::Rect bounds = |
gfx::Rect(icon.width(), icon.height() + kControlVertOffset); |
- button_->extension()->browser_action()->PaintBadge(canvas, bounds, tab_id); |
+ button_->extension()->browser_action()->PaintBadge(canvas->AsCanvas(), |
+ bounds, tab_id); |
} |
return canvas; |
@@ -865,9 +868,9 @@ |
BrowserActionButton* button = browser_action_views_[i]->button(); |
if (button == sender) { |
// Set the dragging image for the icon. |
- scoped_ptr<gfx::Canvas> canvas( |
+ scoped_ptr<gfx::CanvasSkia> canvas( |
browser_action_views_[i]->GetIconWithBadge()); |
- drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, |
+ drag_utils::SetDragImageOnDataObject(*canvas->AsCanvas(), button->size(), press_pt, |
data); |
// Fill in the remaining info. |