| 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/gtk/infobars/extension_infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/extension_infobar_gtk.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "chrome/browser/extensions/extension_context_menu_model.h" | 8 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 SkBitmap bitmap; | 165 SkBitmap bitmap; |
| 166 if (button_) { | 166 if (button_) { |
| 167 gfx::ImageSkia* drop_image = rb.GetImageSkiaNamed(IDR_APP_DROPARROW); | 167 gfx::ImageSkia* drop_image = rb.GetImageSkiaNamed(IDR_APP_DROPARROW); |
| 168 | 168 |
| 169 int image_size = extension_misc::EXTENSION_ICON_BITTY; | 169 int image_size = extension_misc::EXTENSION_ICON_BITTY; |
| 170 // The margin between the extension icon and the drop-down arrow bitmap. | 170 // The margin between the extension icon and the drop-down arrow bitmap. |
| 171 static const int kDropArrowLeftMargin = 3; | 171 static const int kDropArrowLeftMargin = 3; |
| 172 scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas( | 172 scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas( |
| 173 gfx::Size(image_size + kDropArrowLeftMargin + drop_image->width(), | 173 gfx::Size(image_size + kDropArrowLeftMargin + drop_image->width(), |
| 174 image_size), ui::SCALE_FACTOR_100P, false)); | 174 image_size), 1.0f, false)); |
| 175 canvas->DrawImageInt(*icon, 0, 0, icon->width(), icon->height(), 0, 0, | 175 canvas->DrawImageInt(*icon, 0, 0, icon->width(), icon->height(), 0, 0, |
| 176 image_size, image_size, false); | 176 image_size, image_size, false); |
| 177 canvas->DrawImageInt(*drop_image, image_size + kDropArrowLeftMargin, | 177 canvas->DrawImageInt(*drop_image, image_size + kDropArrowLeftMargin, |
| 178 image_size / 2); | 178 image_size / 2); |
| 179 bitmap = canvas->ExtractImageRep().sk_bitmap(); | 179 bitmap = canvas->ExtractImageRep().sk_bitmap(); |
| 180 } else { | 180 } else { |
| 181 bitmap = *icon->bitmap(); | 181 bitmap = *icon->bitmap(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(bitmap); | 184 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(bitmap); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 gboolean ExtensionInfoBarGtk::OnExpose(GtkWidget* sender, | 240 gboolean ExtensionInfoBarGtk::OnExpose(GtkWidget* sender, |
| 241 GdkEventExpose* event) { | 241 GdkEventExpose* event) { |
| 242 TRACE_EVENT0("ui::gtk", "ExtensionInfoBarGtk::OnExpose"); | 242 TRACE_EVENT0("ui::gtk", "ExtensionInfoBarGtk::OnExpose"); |
| 243 | 243 |
| 244 // We also need to draw our infobar arrows over the renderer. | 244 // We also need to draw our infobar arrows over the renderer. |
| 245 static_cast<InfoBarContainerGtk*>(container())-> | 245 static_cast<InfoBarContainerGtk*>(container())-> |
| 246 PaintInfobarBitsOn(sender, event, this); | 246 PaintInfobarBitsOn(sender, event, this); |
| 247 | 247 |
| 248 return FALSE; | 248 return FALSE; |
| 249 } | 249 } |
| OLD | NEW |