summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h4
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h2
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm6
-rw-r--r--chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc3
-rw-r--r--chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc3
-rw-r--r--chrome/browser/ui/cocoa/table_row_nsimage_cache.h9
-rw-r--r--chrome/browser/ui/cocoa/table_row_nsimage_cache.mm6
-rw-r--r--chrome/browser/ui/cocoa/task_manager_mac.h9
-rw-r--r--chrome/browser/ui/cocoa/task_manager_mac.mm3
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc6
-rw-r--r--chrome/browser/ui/search_engines/template_url_table_model.cc4
-rw-r--r--chrome/browser/ui/search_engines/template_url_table_model.h1
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc8
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc19
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc5
-rw-r--r--chrome/browser/ui/views/avatar_menu_bubble_view.cc13
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.cc6
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.h2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc14
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc10
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc4
-rw-r--r--chrome/browser/ui/views/detachable_toolbar_view.cc9
-rw-r--r--chrome/browser/ui/views/download/download_item_view.cc194
-rw-r--r--chrome/browser/ui/views/download/download_item_view.h38
-rw-r--r--chrome/browser/ui/views/dropdown_bar_view.cc14
-rw-r--r--chrome/browser/ui/views/dropdown_bar_view.h4
-rw-r--r--chrome/browser/ui/views/extensions/extension_install_dialog_view.cc8
-rw-r--r--chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc4
-rw-r--r--chrome/browser/ui/views/find_bar_view.cc7
-rw-r--r--chrome/browser/ui/views/find_bar_view.h4
-rw-r--r--chrome/browser/ui/views/infobars/extension_infobar.cc11
-rw-r--r--chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc6
-rw-r--r--chrome/browser/ui/views/location_bar/icon_label_bubble_view.h6
-rw-r--r--chrome/browser/ui/views/location_bar/keyword_hint_view.cc22
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc6
-rw-r--r--chrome/browser/ui/views/menu_item_view_test.cc4
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc8
-rw-r--r--chrome/browser/ui/views/page_info_bubble_view.cc10
-rw-r--r--chrome/browser/ui/views/speech_recognition_bubble_views.cc10
-rw-r--r--chrome/browser/ui/views/tab_icon_view.cc24
-rw-r--r--chrome/browser/ui/views/tab_icon_view.h4
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.cc11
-rw-r--r--chrome/browser/ui/views/tabs/tab.cc45
-rw-r--r--chrome/browser/ui/views/tabs/tab.h6
-rw-r--r--chrome/browser/ui/views/tabs/tab_drag_controller.cc22
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc20
-rw-r--r--chrome/browser/ui/views/theme_background.cc10
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc21
-rw-r--r--chrome/browser/ui/views/toolbar_view.h6
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_login_handler.cc3
-rw-r--r--chrome/browser/ui/webui/options2/browser_options_handler2.cc6
-rw-r--r--chrome/browser/ui/webui/options2/manage_profile_handler2.cc4
-rw-r--r--chrome/browser/ui/webui/task_manager/task_manager_handler.cc2
-rw-r--r--chrome/browser/ui/webui/web_ui_util.cc5
-rw-r--r--chrome/browser/ui/webui/web_ui_util.h10
56 files changed, 365 insertions, 338 deletions
diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
index ea71fe0..de78a12 100644
--- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
+++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -50,7 +50,7 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegateCustomSheet,
// Controller for the collected cookies dialog. This class stores an internal
// copy of the CookiesTreeModel but with Cocoa-converted values (NSStrings and
-// NSImages instead of std::strings and SkBitmaps). Doing this allows us to use
+// NSImages instead of std::strings and ImageSkias). Doing this allows us to use
// bindings for the interface. Changes are pushed to this internal model via a
// very thin bridge (see cookies_window_controller.h).
@interface CollectedCookiesWindowController : NSWindowController
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
index 9cab254..0ac16b0 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
@@ -13,7 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/extensions/extension_install_ui.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
class Profile;
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index 504edb9..809c575 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -30,7 +30,7 @@ using extensions::BundleInstaller;
@interface ExtensionInstallDialogController ()
- (BOOL)isBundleInstall;
- (BOOL)isInlineInstall;
-- (void)appendRatingStar:(const SkBitmap*)skiaImage;
+- (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage;
@end
namespace {
@@ -66,7 +66,7 @@ void OffsetControlVerticallyToFitContent(NSControl* control,
[control setFrameOrigin:origin];
}
-void AppendRatingStarsShim(const SkBitmap* skiaImage, void* data) {
+void AppendRatingStarsShim(const gfx::ImageSkia* skiaImage, void* data) {
ExtensionInstallDialogController* controller =
static_cast<ExtensionInstallDialogController*>(data);
[controller appendRatingStar:skiaImage];
@@ -297,7 +297,7 @@ void AppendRatingStarsShim(const SkBitmap* skiaImage, void* data) {
return prompt_->type() == ExtensionInstallUI::INLINE_INSTALL_PROMPT;
}
-- (void)appendRatingStar:(const SkBitmap*)skiaImage {
+- (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage {
NSImage* image = gfx::SkBitmapToNSImageWithColorSpace(
*skiaImage, base::mac::GetSystemColorSpace());
NSRect frame = NSMakeRect(0, 0, skiaImage->width(), skiaImage->height());
diff --git a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
index 11577fc..a73b325 100644
--- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
+++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
@@ -1,11 +1,10 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h"
#include "base/utf_string_conversions.h"
-#include "third_party/skia/include/core/SkBitmap.h"
const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage";
diff --git a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
index f0070d0..7fe8f89 100644
--- a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
+++ b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
@@ -1,11 +1,10 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h"
#include "base/utf_string_conversions.h"
-#include "third_party/skia/include/core/SkBitmap.h"
const char MockLinkInfoBarDelegate::kMessage[] = "MockLinkInfoBarMessage ";
const char MockLinkInfoBarDelegate::kLink[] = "http://dev.chromium.org";
diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
index f6713fe..377b639 100644
--- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
+++ b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,7 +10,9 @@
#include "base/memory/scoped_nsobject.h"
-class SkBitmap;
+namespace gfx {
+class ImageSkia;
+}
// There are several dialogs that display tabular data with one SkBitmap
// per row. This class converts these SkBitmaps to NSImages on demand, and
@@ -24,7 +26,7 @@ class TableRowNSImageCache {
virtual int RowCount() const = 0;
// Returns the icon of the |row|th row.
- virtual SkBitmap GetIcon(int row) const = 0;
+ virtual gfx::ImageSkia GetIcon(int row) const = 0;
protected:
virtual ~Table() {}
@@ -53,4 +55,3 @@ class TableRowNSImageCache {
};
#endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_
-
diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm b/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
index ff36a50..4a97811 100644
--- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
+++ b/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "skia/ext/skia_utils_mac.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
TableRowNSImageCache::TableRowNSImageCache(Table* model)
: model_(model),
@@ -66,7 +66,7 @@ NSImage* TableRowNSImageCache::GetImageForRow(int row) {
DCHECK_LT(row, static_cast<int>([icon_images_ count]));
NSImage* image = static_cast<NSImage*>([icon_images_ pointerAtIndex:row]);
if (!image) {
- const SkBitmap bitmap_icon =
+ const gfx::ImageSkia bitmap_icon =
model_->GetIcon(row);
// This means GetIcon() will get called until it returns a non-empty bitmap.
// Empty bitmaps are intentionally not cached.
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.h b/chrome/browser/ui/cocoa/task_manager_mac.h
index 067e14e..bd83c13 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac.h
+++ b/chrome/browser/ui/cocoa/task_manager_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,9 +15,12 @@
#include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h"
@class WindowSizeAutosaver;
-class SkBitmap;
class TaskManagerMac;
+namespace gfx {
+class ImageSkia;
+}
+
// This class is responsible for loading the task manager window and for
// managing it.
@interface TaskManagerWindowController :
@@ -85,7 +88,7 @@ class TaskManagerMac : public TaskManagerModelObserver,
// TableRowNSImageCache::Table
virtual int RowCount() const OVERRIDE;
- virtual SkBitmap GetIcon(int r) const OVERRIDE;
+ virtual gfx::ImageSkia GetIcon(int r) const OVERRIDE;
// Creates the task manager if it doesn't exist; otherwise, it activates the
// existing task manager window. Highlights background resources if
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm
index cc31e27..94d3d3d 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/task_manager_mac.mm
@@ -16,6 +16,7 @@
#include "grit/generated_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#include "ui/gfx/image/image_skia.h"
namespace {
@@ -624,7 +625,7 @@ int TaskManagerMac::RowCount() const {
return model_->ResourceCount();
}
-SkBitmap TaskManagerMac::GetIcon(int r) const {
+gfx::ImageSkia TaskManagerMac::GetIcon(int r) const {
return model_->GetResourceIcon(r);
}
diff --git a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
index 865e3cc..49caddb 100644
--- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
@@ -40,7 +40,7 @@ const int kExtensionsPadding = kPermissionsPadding;
const double kRatingTextSize = 12.1; // 12.1px = 9pt @ 96dpi
// Adds a Skia image as an icon control to the given container.
-void AddResourceIcon(const SkBitmap* icon, void* data) {
+void AddResourceIcon(const gfx::ImageSkia* icon, void* data) {
GtkWidget* container = static_cast<GtkWidget*>(data);
GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(*icon);
GtkWidget* icon_widget = gtk_image_new_from_pixbuf(icon_pixbuf);
diff --git a/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc b/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
index 5161ac7..4099503 100644
--- a/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
@@ -252,8 +252,8 @@ void SpeechRecognitionBubbleGtk::UpdateLayout() {
gtk_widget_get_child_requisition(cancel_button_, &cancel_size);
GtkRequisition label_size;
gtk_widget_get_child_requisition(label_, &label_size);
- SkBitmap* volume = ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_SPEECH_INPUT_MIC_EMPTY);
+ gfx::ImageSkia* volume = ResourceBundle::GetSharedInstance().
+ GetImageSkiaNamed(IDR_SPEECH_INPUT_MIC_EMPTY);
int desired_width = std::max(volume->width(), cancel_size.width) +
kIconHorizontalPadding * 2;
int desired_height = volume->height() + label_size.height +
@@ -274,7 +274,7 @@ void SpeechRecognitionBubbleGtk::UpdateLayout() {
}
void SpeechRecognitionBubbleGtk::UpdateImage() {
- SkBitmap image = icon_image();
+ gfx::ImageSkia image = icon_image();
if (image.isNull() || !bubble_)
return;
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index 662c910c..280f386 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -32,7 +32,7 @@ static const int kOtherGroupID = 1;
// ModelEntry also tracks state information about the URL.
// Icon used while loading, or if a specific favicon can't be found.
-static SkBitmap* default_icon = NULL;
+static gfx::ImageSkia* default_icon = NULL;
class ModelEntry {
public:
@@ -42,7 +42,7 @@ class ModelEntry {
model_(model) {
if (!default_icon) {
default_icon = ResourceBundle::GetSharedInstance().
- GetBitmapNamed(IDR_DEFAULT_FAVICON);
+ GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
}
}
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.h b/chrome/browser/ui/search_engines/template_url_table_model.h
index 78dcb43..5af66d4 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.h
+++ b/chrome/browser/ui/search_engines/template_url_table_model.h
@@ -15,7 +15,6 @@
#include "ui/base/models/table_model.h"
class ModelEntry;
-class SkBitmap;
class TemplateURL;
class TemplateURLService;
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 6862298..a49787b 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -46,12 +46,12 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
#include "ui/base/models/button_menu_item_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
@@ -494,7 +494,7 @@ void WrenchMenuModel::Build() {
#if defined(OS_WIN)
SetIcon(GetIndexOfCommandId(IDC_VIEW_INCOMPATIBILITIES),
*ui::ResourceBundle::GetSharedInstance().
- GetBitmapNamed(IDR_CONFLICT_MENU));
+ GetImageSkiaNamed(IDR_CONFLICT_MENU));
#endif
if (!is_touch_menu) {
@@ -503,7 +503,7 @@ void WrenchMenuModel::Build() {
if (browser_defaults::kShowHelpMenuItemIcon) {
ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance();
SetIcon(GetIndexOfCommandId(IDC_HELP_PAGE),
- *rb.GetBitmapNamed(IDR_HELP_MENU));
+ *rb.GetImageSkiaNamed(IDR_HELP_MENU));
}
}
@@ -535,7 +535,7 @@ void WrenchMenuModel::AddGlobalErrorMenuItems() {
if (icon_id) {
gfx::Image& image = rb.GetImageNamed(icon_id);
SetIcon(GetIndexOfCommandId(error->MenuItemCommandID()),
- *image.ToSkBitmap());
+ *image.ToImageSkia());
}
}
}
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index bd4c96d..8108e9b 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -148,15 +148,16 @@ void AboutChromeView::Init() {
throbber_->set_owned_by_client();
throbber_->SetVisible(false);
- SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE);
+ gfx::ImageSkia* success_image = rb.GetImageSkiaNamed(IDR_UPDATE_UPTODATE);
success_indicator_.SetImage(*success_image);
success_indicator_.set_owned_by_client();
- SkBitmap* update_available_image = rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE);
+ gfx::ImageSkia* update_available_image = rb.GetImageSkiaNamed(
+ IDR_UPDATE_AVAILABLE);
update_available_indicator_.SetImage(*update_available_image);
update_available_indicator_.set_owned_by_client();
- SkBitmap* timeout_image = rb.GetBitmapNamed(IDR_UPDATE_FAIL);
+ gfx::ImageSkia* timeout_image = rb.GetImageSkiaNamed(IDR_UPDATE_FAIL);
timeout_indicator_.SetImage(*timeout_image);
timeout_indicator_.set_owned_by_client();
@@ -164,12 +165,12 @@ void AboutChromeView::Init() {
update_label_.set_owned_by_client();
// Regular view controls we draw by ourself. First, we add the background
- // image for the dialog. We have two different background bitmaps, one for
- // LTR UIs and one for RTL UIs. We load the correct bitmap based on the UI
+ // image for the dialog. We have two different background images, one for
+ // LTR UIs and one for RTL UIs. We load the correct image based on the UI
// layout of the view.
about_dlg_background_logo_ = new views::ImageView();
- SkBitmap* about_background_logo = rb.GetBitmapNamed(base::i18n::IsRTL() ?
- IDR_ABOUT_BACKGROUND_RTL : IDR_ABOUT_BACKGROUND);
+ gfx::ImageSkia* about_background_logo = rb.GetImageSkiaNamed(
+ base::i18n::IsRTL() ? IDR_ABOUT_BACKGROUND_RTL : IDR_ABOUT_BACKGROUND);
about_dlg_background_logo_->SetImage(*about_background_logo);
AddChildView(about_dlg_background_logo_);
@@ -425,8 +426,8 @@ void AboutChromeView::OnPaint(gfx::Canvas* canvas) {
// Draw the background image color (and the separator) across the dialog.
// This will become the background for the logo image at the top of the
// dialog.
- SkBitmap* background = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_ABOUT_BACKGROUND_COLOR);
+ gfx::ImageSkia* background = ui::ResourceBundle::GetSharedInstance().
+ GetImageSkiaNamed(IDR_ABOUT_BACKGROUND_COLOR);
canvas->TileImageInt(*background, 0, 0, dialog_dimensions_.width(),
background->height());
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
index 9a6c508..46f50f2 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
@@ -20,11 +20,11 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
-#include "ui/base/native_theme/native_theme.h"
namespace {
@@ -117,7 +117,8 @@ AutocompleteResultView::AutocompleteResultView(
animation_(new ui::SlideAnimation(this))) {
CHECK_GE(model_index, 0);
if (default_icon_size_ == 0) {
- default_icon_size_ = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ default_icon_size_ =
+ ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))->
width();
}
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
index fbcf0e0..f78fdb2 100644
--- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc
+++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
@@ -163,7 +163,7 @@ class ProfileItemView : public views::CustomButton,
const AvatarMenuModel::Item& item() { return item_; }
private:
- static SkBitmap GetBadgedIcon(const SkBitmap& icon);
+ static gfx::ImageSkia GetBadgedIcon(const gfx::ImageSkia& icon);
bool IsHighlighted();
@@ -180,9 +180,9 @@ ProfileItemView::ProfileItemView(const AvatarMenuModel::Item& item,
: views::CustomButton(switch_profile_listener),
item_(item) {
image_view_ = new ProfileImageView();
- SkBitmap profile_icon = *item_.icon.ToSkBitmap();
+ gfx::ImageSkia profile_icon = *item_.icon.ToImageSkia();
if (item_.active) {
- SkBitmap badged_icon(GetBadgedIcon(profile_icon));
+ gfx::ImageSkia badged_icon(GetBadgedIcon(profile_icon));
image_view_->SetImage(badged_icon);
} else {
image_view_->SetImage(profile_icon);
@@ -241,7 +241,7 @@ void ProfileItemView::Layout() {
icon_rect.set_size(image_view_->GetPreferredSize());
icon_rect.set_y((height() - icon_rect.height()) / 2);
} else {
- const SkBitmap& icon = image_view_->GetImage();
+ const gfx::ImageSkia& icon = image_view_->GetImage();
icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(), 0, 0,
profiles::kAvatarIconWidth, height());
}
@@ -312,12 +312,13 @@ void ProfileItemView::OnFocusStateChanged(bool has_focus) {
}
// static
-SkBitmap ProfileItemView::GetBadgedIcon(const SkBitmap& icon) {
+gfx::ImageSkia ProfileItemView::GetBadgedIcon(const gfx::ImageSkia& icon) {
gfx::Rect icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(),
0, 0, profiles::kAvatarIconWidth, kItemHeight);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const SkBitmap* badge = rb.GetImageNamed(IDR_PROFILE_SELECTED).ToSkBitmap();
+ const gfx::ImageSkia* badge = rb.GetImageNamed(
+ IDR_PROFILE_SELECTED).ToImageSkia();
const float kBadgeOverlapRatioX = 1.0f / 5.0f;
int width = icon_rect.width() + badge->width() * kBadgeOverlapRatioX;
const float kBadgeOverlapRatioY = 1.0f / 3.0f;
diff --git a/chrome/browser/ui/views/avatar_menu_button.cc b/chrome/browser/ui/views/avatar_menu_button.cc
index 532f795..154c97f 100644
--- a/chrome/browser/ui/views/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/avatar_menu_button.cc
@@ -69,7 +69,7 @@ void DrawTaskBarDecoration(gfx::NativeWindow window, const gfx::Image* image) {
profiles::kAvatarIconWidth - x * 2, profiles::kAvatarIconHeight));
source_bitmap = &squarer_bitmap;
} else {
- // The bitmaps size has changed. Resize what we have.
+ // The image's size has changed. Resize what we have.
source_bitmap = bitmap;
}
// Since the target size is so small, we use our best resizer. Never pass
@@ -108,7 +108,7 @@ void AvatarMenuButton::OnPaint(gfx::Canvas* canvas) {
if (old_height_ != height() || button_icon_.isNull()) {
old_height_ = height();
button_icon_ = *profiles::GetAvatarIconForTitleBar(
- *icon_, is_gaia_picture_, width(), height()).ToSkBitmap();
+ *icon_, is_gaia_picture_, width(), height()).ToImageSkia();
}
// Scale the image to fit the width of the button.
@@ -141,7 +141,7 @@ bool AvatarMenuButton::HitTest(const gfx::Point& point) const {
void AvatarMenuButton::SetAvatarIcon(const gfx::Image& icon,
bool is_gaia_picture) {
icon_.reset(new gfx::Image(icon));
- button_icon_ = SkBitmap();
+ button_icon_ = gfx::ImageSkia();
is_gaia_picture_ = is_gaia_picture;
SchedulePaint();
}
diff --git a/chrome/browser/ui/views/avatar_menu_button.h b/chrome/browser/ui/views/avatar_menu_button.h
index dbd8ffe..502cbb7 100644
--- a/chrome/browser/ui/views/avatar_menu_button.h
+++ b/chrome/browser/ui/views/avatar_menu_button.h
@@ -60,7 +60,7 @@ class AvatarMenuButton : public views::MenuButton,
// Use a scoped ptr because gfx::Image doesn't have a default constructor.
scoped_ptr<gfx::Image> icon_;
- SkBitmap button_icon_;
+ gfx::ImageSkia button_icon_;
bool is_gaia_picture_;
int old_height_;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 2c1c0c1..b23a163 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -94,10 +94,10 @@ const char BookmarkBarView::kViewClassName[] =
static const int kButtonPadding = 0;
// Icon to display when one isn't found for the page.
-static SkBitmap* kDefaultFavicon = NULL;
+static gfx::ImageSkia* kDefaultFavicon = NULL;
// Icon used for folders.
-static SkBitmap* kFolderIcon = NULL;
+static gfx::ImageSkia* kFolderIcon = NULL;
// Offset for where the menu is shown relative to the bottom of the
// BookmarkBarView.
@@ -358,11 +358,11 @@ const int BookmarkBarView::kNewtabVerticalPadding = 12;
// static
bool BookmarkBarView::testing_ = false;
-// Returns the bitmap to use for starred folders.
-static const SkBitmap& GetFolderIcon() {
+// Returns the image to use for starred folders.
+static const gfx::ImageSkia& GetFolderIcon() {
if (!kFolderIcon) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kFolderIcon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
+ kFolderIcon = rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
}
return *kFolderIcon;
}
@@ -1120,7 +1120,7 @@ void BookmarkBarView::Init() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (!kDefaultFavicon)
- kDefaultFavicon = rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
+ kDefaultFavicon = rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
// Child views are traversed in the order they are added. Make sure the order
// they are added matches the visual order.
@@ -1195,7 +1195,7 @@ MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() {
MenuButton* BookmarkBarView::CreateOverflowButton() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
MenuButton* button = new OverFlowButton(this);
- button->SetIcon(*rb.GetBitmapNamed(IDR_BOOKMARK_BAR_CHEVRONS));
+ button->SetIcon(*rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_CHEVRONS));
// The overflow button's image contains an arrow and therefore it is a
// direction sensitive image and we need to flip it if the UI layout is
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 371c6e9..882479c 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -436,7 +436,7 @@ void BookmarkMenuDelegate::BuildMenuForPermanentNode(
int id = *next_menu_id;
(*next_menu_id)++;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- SkBitmap* folder_icon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
+ gfx::ImageSkia* folder_icon = rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
id, node->GetTitle(), *folder_icon);
BuildMenu(node, 0, submenu, next_menu_id);
@@ -455,14 +455,16 @@ void BookmarkMenuDelegate::BuildMenu(const BookmarkNode* parent,
(*next_menu_id)++;
if (node->is_url()) {
- SkBitmap icon = profile_->GetBookmarkModel()->GetFavicon(node);
+ gfx::ImageSkia icon = gfx::ImageSkia(
+ profile_->GetBookmarkModel()->GetFavicon(node));
if (icon.width() == 0) {
- icon = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
+ icon = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
}
menu->AppendMenuItemWithIcon(id, node->GetTitle(), icon);
node_to_menu_id_map_[node] = id;
} else if (node->is_folder()) {
- SkBitmap* folder_icon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
+ gfx::ImageSkia* folder_icon =
+ rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
id, node->GetTitle(), *folder_icon);
node_to_menu_id_map_[node] = id;
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 0bb36ff..7f23ba6 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -61,7 +61,7 @@ namespace views {
class ClientView;
}
-// An enumeration of bitmap resources used by this window.
+// An enumeration of image resources used by this window.
enum {
FRAME_PART_IMAGE_FIRST = 0, // Must be first.
@@ -291,7 +291,7 @@ ConstrainedWindowFrameView::ConstrainedWindowFrameView(
InitWindowResources();
// Constrained windows always use the custom frame - they just have a
- // different set of bitmaps.
+ // different set of images.
container->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
diff --git a/chrome/browser/ui/views/detachable_toolbar_view.cc b/chrome/browser/ui/views/detachable_toolbar_view.cc
index 026b7ea..c0a0e47 100644
--- a/chrome/browser/ui/views/detachable_toolbar_view.cc
+++ b/chrome/browser/ui/views/detachable_toolbar_view.cc
@@ -7,10 +7,10 @@
#include "chrome/browser/themes/theme_service.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkShader.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/window/non_client_view.h"
@@ -30,17 +30,18 @@ void DetachableToolbarView::PaintBackgroundAttachedMode(
ui::ThemeProvider* tp = view->GetThemeProvider();
canvas->FillRect(view->GetLocalBounds(),
tp->GetColor(ThemeService::COLOR_TOOLBAR));
- canvas->TileImageInt(*tp->GetBitmapNamed(IDR_THEME_TOOLBAR),
+ canvas->TileImageInt(*tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR),
background_origin.x(), background_origin.y(), 0, 0,
view->width(), view->height());
#if defined(USE_ASH)
// Ash provides additional lightening at the edges of the toolbar.
- SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_TOOLBAR_SHADE_LEFT);
+ gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_LEFT);
canvas->TileImageInt(*toolbar_left,
0, 0,
0, 0,
toolbar_left->width(), view->height());
- SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_TOOLBAR_SHADE_RIGHT);
+ gfx::ImageSkia* toolbar_right =
+ tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_RIGHT);
canvas->TileImageInt(*toolbar_right,
0, 0,
view->width() - toolbar_right->width(), 0,
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index d0894f6..1dba4ef 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -109,75 +109,75 @@ DownloadItemView::DownloadItemView(DownloadItem* download,
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
BodyImageSet normal_body_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM)
};
normal_body_image_set_ = normal_body_image_set;
DropDownImageSet normal_drop_down_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM)
};
normal_drop_down_image_set_ = normal_drop_down_image_set;
BodyImageSet hot_body_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_H)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_H)
};
hot_body_image_set_ = hot_body_image_set;
DropDownImageSet hot_drop_down_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_H),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_H)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_H),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_H)
};
hot_drop_down_image_set_ = hot_drop_down_image_set;
BodyImageSet pushed_body_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_P)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_P)
};
pushed_body_image_set_ = pushed_body_image_set;
DropDownImageSet pushed_drop_down_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_P),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_P)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_P),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_P)
};
pushed_drop_down_image_set_ = pushed_drop_down_image_set;
BodyImageSet dangerous_mode_body_image_set = {
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_NO_DD),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_NO_DD),
- rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_NO_DD)
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_NO_DD),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_NO_DD),
+ rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_NO_DD)
};
dangerous_mode_body_image_set_ = dangerous_mode_body_image_set;
@@ -738,20 +738,20 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
canvas->Translate(gfx::Point(width(), 0));
canvas->Scale(-1, 1);
}
- PaintBitmaps(canvas,
- body_image_set->top_left, body_image_set->left,
- body_image_set->bottom_left,
- x, box_y_, box_height_, body_image_set->top_left->width());
+ PaintImages(canvas,
+ body_image_set->top_left, body_image_set->left,
+ body_image_set->bottom_left,
+ x, box_y_, box_height_, body_image_set->top_left->width());
x += body_image_set->top_left->width();
- PaintBitmaps(canvas,
- body_image_set->top, body_image_set->center,
- body_image_set->bottom,
- x, box_y_, box_height_, center_width);
+ PaintImages(canvas,
+ body_image_set->top, body_image_set->center,
+ body_image_set->bottom,
+ x, box_y_, box_height_, center_width);
x += center_width;
- PaintBitmaps(canvas,
- body_image_set->top_right, body_image_set->right,
- body_image_set->bottom_right,
- x, box_y_, box_height_, body_image_set->top_right->width());
+ PaintImages(canvas,
+ body_image_set->top_right, body_image_set->right,
+ body_image_set->bottom_right,
+ x, box_y_, box_height_, body_image_set->top_right->width());
// Overlay our body hot state. Warning dialogs don't display body a hot state.
if (!IsShowingWarningDialog() &&
@@ -761,21 +761,21 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
int x = kLeftPadding;
- PaintBitmaps(canvas,
- hot_body_image_set_.top_left, hot_body_image_set_.left,
- hot_body_image_set_.bottom_left,
- x, box_y_, box_height_, hot_body_image_set_.top_left->width());
+ PaintImages(canvas,
+ hot_body_image_set_.top_left, hot_body_image_set_.left,
+ hot_body_image_set_.bottom_left,
+ x, box_y_, box_height_, hot_body_image_set_.top_left->width());
x += body_image_set->top_left->width();
- PaintBitmaps(canvas,
- hot_body_image_set_.top, hot_body_image_set_.center,
- hot_body_image_set_.bottom,
- x, box_y_, box_height_, center_width);
+ PaintImages(canvas,
+ hot_body_image_set_.top, hot_body_image_set_.center,
+ hot_body_image_set_.bottom,
+ x, box_y_, box_height_, center_width);
x += center_width;
- PaintBitmaps(canvas,
- hot_body_image_set_.top_right, hot_body_image_set_.right,
- hot_body_image_set_.bottom_right,
- x, box_y_, box_height_,
- hot_body_image_set_.top_right->width());
+ PaintImages(canvas,
+ hot_body_image_set_.top_right, hot_body_image_set_.right,
+ hot_body_image_set_.bottom_right,
+ x, box_y_, box_height_,
+ hot_body_image_set_.top_right->width());
canvas->Restore();
}
@@ -783,10 +783,10 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
// Paint the drop-down.
if (drop_down_image_set) {
- PaintBitmaps(canvas,
- drop_down_image_set->top, drop_down_image_set->center,
- drop_down_image_set->bottom,
- x, box_y_, box_height_, drop_down_image_set->top->width());
+ PaintImages(canvas,
+ drop_down_image_set->top, drop_down_image_set->center,
+ drop_down_image_set->bottom,
+ x, box_y_, box_height_, drop_down_image_set->top->width());
// Overlay our drop-down hot state.
if (drop_hover_animation_->GetCurrentValue() > 0) {
@@ -794,10 +794,10 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255));
canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
- PaintBitmaps(canvas,
- drop_down_image_set->top, drop_down_image_set->center,
- drop_down_image_set->bottom,
- x, box_y_, box_height_, drop_down_image_set->top->width());
+ PaintImages(canvas,
+ drop_down_image_set->top, drop_down_image_set->center,
+ drop_down_image_set->bottom,
+ x, box_y_, box_height_, drop_down_image_set->top->width());
canvas->Restore();
}
@@ -849,11 +849,11 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
IconManager* im = g_browser_process->icon_manager();
gfx::Image* image = im->LookupIcon(download_->GetUserVerifiedFilePath(),
IconLoader::SMALL);
- const SkBitmap* icon = NULL;
+ const gfx::ImageSkia* icon = NULL;
if (IsShowingWarningDialog())
icon = warning_icon_;
else if (image)
- icon = image->ToSkBitmap();
+ icon = image->ToImageSkia();
// We count on the fact that the icon manager will cache the icons and if one
// is available, it will be cached here. We *don't* want to request the icon
@@ -933,26 +933,26 @@ void DownloadItemView::LoadIconIfItemPathChanged() {
// Load an icon for the file type we're downloading, and animate any in progress
// download state.
-void DownloadItemView::PaintBitmaps(gfx::Canvas* canvas,
- const SkBitmap* top_bitmap,
- const SkBitmap* center_bitmap,
- const SkBitmap* bottom_bitmap,
- int x, int y, int height, int width) {
- int middle_height = height - top_bitmap->height() - bottom_bitmap->height();
+void DownloadItemView::PaintImages(gfx::Canvas* canvas,
+ const gfx::ImageSkia* top_image,
+ const gfx::ImageSkia* center_image,
+ const gfx::ImageSkia* bottom_image,
+ int x, int y, int height, int width) {
+ int middle_height = height - top_image->height() - bottom_image->height();
// Draw the top.
- canvas->DrawBitmapInt(*top_bitmap,
- 0, 0, top_bitmap->width(), top_bitmap->height(),
- x, y, width, top_bitmap->height(), false);
- y += top_bitmap->height();
+ canvas->DrawBitmapInt(*top_image,
+ 0, 0, top_image->width(), top_image->height(),
+ x, y, width, top_image->height(), false);
+ y += top_image->height();
// Draw the center.
- canvas->DrawBitmapInt(*center_bitmap,
- 0, 0, center_bitmap->width(), center_bitmap->height(),
+ canvas->DrawBitmapInt(*center_image,
+ 0, 0, center_image->width(), center_image->height(),
x, y, width, middle_height, false);
y += middle_height;
// Draw the bottom.
- canvas->DrawBitmapInt(*bottom_bitmap,
- 0, 0, bottom_bitmap->width(), bottom_bitmap->height(),
- x, y, width, bottom_bitmap->height(), false);
+ canvas->DrawBitmapInt(*bottom_image,
+ 0, 0, bottom_image->width(), bottom_image->height(),
+ x, y, width, bottom_image->height(), false);
}
void DownloadItemView::SetState(State body_state, State drop_down_state) {
@@ -1033,10 +1033,10 @@ void DownloadItemView::ShowWarningDialog() {
// The dangerous download label text and icon are different under
// different cases.
if (mode_ == MALICIOUS_MODE) {
- warning_icon_ = rb.GetBitmapNamed(IDR_SAFEBROWSING_WARNING);
+ warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING);
} else {
// The download file has dangerous file type (e.g.: an executable).
- warning_icon_ = rb.GetBitmapNamed(IDR_WARNING);
+ warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING);
}
string16 dangerous_label = model_->GetWarningText(font_, kTextWidth);
dangerous_download_label_ = new views::Label(dangerous_label);
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h
index 387ab47..342f538 100644
--- a/chrome/browser/ui/views/download/download_item_view.h
+++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -37,11 +37,11 @@
class BaseDownloadItemModel;
class DownloadShelfView;
-class SkBitmap;
class DownloadShelfContextMenuView;
namespace gfx {
class Image;
+class ImageSkia;
}
namespace ui {
@@ -120,22 +120,22 @@ class DownloadItemView : public views::ButtonListener,
// The image set associated with the part containing the icon and text.
struct BodyImageSet {
- SkBitmap* top_left;
- SkBitmap* left;
- SkBitmap* bottom_left;
- SkBitmap* top;
- SkBitmap* center;
- SkBitmap* bottom;
- SkBitmap* top_right;
- SkBitmap* right;
- SkBitmap* bottom_right;
+ gfx::ImageSkia* top_left;
+ gfx::ImageSkia* left;
+ gfx::ImageSkia* bottom_left;
+ gfx::ImageSkia* top;
+ gfx::ImageSkia* center;
+ gfx::ImageSkia* bottom;
+ gfx::ImageSkia* top_right;
+ gfx::ImageSkia* right;
+ gfx::ImageSkia* bottom_right;
};
// The image set associated with the drop-down button on the right.
struct DropDownImageSet {
- SkBitmap* top;
- SkBitmap* center;
- SkBitmap* bottom;
+ gfx::ImageSkia* top;
+ gfx::ImageSkia* center;
+ gfx::ImageSkia* bottom;
};
void OpenDownload();
@@ -143,12 +143,12 @@ class DownloadItemView : public views::ButtonListener,
void LoadIcon();
void LoadIconIfItemPathChanged();
- // Convenience method to paint the 3 vertical bitmaps (bottom, middle, top)
+ // Convenience method to paint the 3 vertical images (bottom, middle, top)
// that form the background.
- void PaintBitmaps(gfx::Canvas* canvas,
- const SkBitmap* top_bitmap,
- const SkBitmap* center_bitmap,
- const SkBitmap* bottom_bitmap,
+ void PaintImages(gfx::Canvas* canvas,
+ const gfx::ImageSkia* top_image,
+ const gfx::ImageSkia* center_image,
+ const gfx::ImageSkia* bottom_image,
int x,
int y,
int height,
@@ -208,7 +208,7 @@ class DownloadItemView : public views::ButtonListener,
DropDownImageSet pushed_drop_down_image_set_;
// The warning icon showns for dangerous downloads.
- const SkBitmap* warning_icon_;
+ const gfx::ImageSkia* warning_icon_;
// The model we query for display information
content::DownloadItem* download_;
diff --git a/chrome/browser/ui/views/dropdown_bar_view.cc b/chrome/browser/ui/views/dropdown_bar_view.cc
index 42e1f3b..4ef555b 100644
--- a/chrome/browser/ui/views/dropdown_bar_view.cc
+++ b/chrome/browser/ui/views/dropdown_bar_view.cc
@@ -63,7 +63,7 @@ void DropdownBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
origin = browser_view_->OffsetPointForToolbarBackgroundImage(origin);
ui::ThemeProvider* tp = view->GetThemeProvider();
- SkBitmap background = *tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
+ gfx::ImageSkia background = *tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
int left_edge_width = left_alpha_mask_->width();
int right_edge_width = right_alpha_mask_->width();
@@ -129,11 +129,11 @@ void DropdownBarView::SetBackground(const gfx::ImageSkia* left_alpha_mask,
right_alpha_mask));
}
-void DropdownBarView::SetBorder(int left_border_bitmap_id,
- int middle_border_bitmap_id,
- int right_border_bitmap_id) {
- int border_bitmap_ids[3] = {left_border_bitmap_id, middle_border_bitmap_id,
- right_border_bitmap_id};
+void DropdownBarView::SetBorder(int left_border_image_id,
+ int middle_border_image_id,
+ int right_border_image_id) {
+ int border_image_ids[3] = {left_border_image_id, middle_border_image_id,
+ right_border_image_id};
set_border(views::Border::CreateBorderPainter(
- new views::HorizontalPainter(border_bitmap_ids)));
+ new views::HorizontalPainter(border_image_ids)));
}
diff --git a/chrome/browser/ui/views/dropdown_bar_view.h b/chrome/browser/ui/views/dropdown_bar_view.h
index a8b7c01..25257a0 100644
--- a/chrome/browser/ui/views/dropdown_bar_view.h
+++ b/chrome/browser/ui/views/dropdown_bar_view.h
@@ -43,8 +43,8 @@ class DropdownBarView : public views::AccessiblePaneView,
void SetBackground(const gfx::ImageSkia* left_alpha_mask,
const gfx::ImageSkia* right_alpha_mask);
- void SetBorder(int left_border_bitmap_id, int middle_border_bitmap_id,
- int right_border_bitmap_id);
+ void SetBorder(int left_border_image_id, int middle_border_image_id,
+ int right_border_image_id);
private:
// The dropdown bar host that controls this view.
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index 6b348bd..9b51512 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -62,7 +62,7 @@ const int kHeadingFontSizeDelta = 1;
const int kRatingFontSizeDelta = -1;
-void AddResourceIcon(const SkBitmap* skia_image, void* data) {
+void AddResourceIcon(const gfx::ImageSkia* skia_image, void* data) {
views::View* parent = static_cast<views::View*>(data);
views::ImageView* image_view = new views::ImageView();
image_view->SetImage(*skia_image);
@@ -184,13 +184,13 @@ ExtensionInstallDialogView::ExtensionInstallDialogView(
if (!is_bundle_install()) {
// Scale down to icon size, but allow smaller icons (don't scale up).
- const SkBitmap* bitmap = prompt.icon().ToSkBitmap();
- gfx::Size size(bitmap->width(), bitmap->height());
+ const gfx::ImageSkia* image = prompt.icon().ToImageSkia();
+ gfx::Size size(image->width(), image->height());
if (size.width() > kIconSize || size.height() > kIconSize)
size = gfx::Size(kIconSize, kIconSize);
views::ImageView* icon = new views::ImageView();
icon->SetImageSize(size);
- icon->SetImage(*bitmap);
+ icon->SetImage(*image);
icon->SetHorizontalAlignment(views::ImageView::CENTER);
icon->SetVerticalAlignment(views::ImageView::CENTER);
int icon_row_span = 1;
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
index 75d0fed..0da9d4a 100644
--- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -81,7 +81,7 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView {
ExtensionUninstallDialogDelegateView(
ExtensionUninstallDialogViews* dialog_view,
const extensions::Extension* extension,
- SkBitmap* icon);
+ gfx::ImageSkia* icon);
virtual ~ExtensionUninstallDialogDelegateView();
// Called when the ExtensionUninstallDialog has been destroyed to make sure
@@ -157,7 +157,7 @@ void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() {
ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
ExtensionUninstallDialogViews* dialog_view,
const extensions::Extension* extension,
- SkBitmap* icon)
+ gfx::ImageSkia* icon)
: dialog_(dialog_view) {
// Scale down to icon size, but allow smaller icons (don't scale up).
gfx::Size size(icon->width(), icon->height());
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 34695e0..dd92b6c 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -147,11 +147,12 @@ FindBarView::FindBarView(FindBarHost* host)
SetBorder(IDR_FIND_DIALOG_LEFT, IDR_FIND_DIALOG_MIDDLE,
IDR_FIND_DIALOG_RIGHT);
- preferred_height_ = rb.GetBitmapNamed(IDR_FIND_DIALOG_MIDDLE)->height();
+ preferred_height_ = rb.GetImageSkiaNamed(IDR_FIND_DIALOG_MIDDLE)->height();
// Background images for the Find edit box.
- text_box_background_ = rb.GetBitmapNamed(IDR_FIND_BOX_BACKGROUND);
- text_box_background_left_ = rb.GetBitmapNamed(IDR_FIND_BOX_BACKGROUND_LEFT);
+ text_box_background_ = rb.GetImageSkiaNamed(IDR_FIND_BOX_BACKGROUND);
+ text_box_background_left_ =
+ rb.GetImageSkiaNamed(IDR_FIND_BOX_BACKGROUND_LEFT);
EnableCanvasFlippingForRTLUI(true);
}
diff --git a/chrome/browser/ui/views/find_bar_view.h b/chrome/browser/ui/views/find_bar_view.h
index 5ccfedb..fcc704f 100644
--- a/chrome/browser/ui/views/find_bar_view.h
+++ b/chrome/browser/ui/views/find_bar_view.h
@@ -140,10 +140,10 @@ class FindBarView : public DropdownBarView,
// The background image for the Find text box, which we draw behind the Find
// box to provide the Chrome look to the edge of the text box.
- const SkBitmap* text_box_background_;
+ const gfx::ImageSkia* text_box_background_;
// The rounded edge on the left side of the Find text box.
- const SkBitmap* text_box_background_left_;
+ const gfx::ImageSkia* text_box_background_left_;
DISALLOW_COPY_AND_ASSIGN(FindBarView);
};
diff --git a/chrome/browser/ui/views/infobars/extension_infobar.cc b/chrome/browser/ui/views/infobars/extension_infobar.cc
index 646ec46..0811dd7 100644
--- a/chrome/browser/ui/views/infobars/extension_infobar.cc
+++ b/chrome/browser/ui/views/infobars/extension_infobar.cc
@@ -108,18 +108,19 @@ void ExtensionInfoBar::OnImageLoaded(const gfx::Image& image,
if (!GetDelegate())
return; // The delegate can go away while we asynchronously load images.
- const SkBitmap* icon = NULL;
+ const gfx::ImageSkia* icon = NULL;
// Fall back on the default extension icon on failure.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (image.IsEmpty())
- icon = rb.GetImageNamed(IDR_EXTENSIONS_SECTION).ToSkBitmap();
+ icon = rb.GetImageNamed(IDR_EXTENSIONS_SECTION).ToImageSkia();
else
- icon = image.ToSkBitmap();
+ icon = image.ToImageSkia();
- const SkBitmap* drop_image = rb.GetImageNamed(IDR_APP_DROPARROW).ToSkBitmap();
+ const gfx::ImageSkia* drop_image =
+ rb.GetImageNamed(IDR_APP_DROPARROW).ToImageSkia();
int image_size = ExtensionIconSet::EXTENSION_ICON_BITTY;
- // The margin between the extension icon and the drop-down arrow bitmap.
+ // The margin between the extension icon and the drop-down arrow image.
static const int kDropArrowLeftMargin = 3;
scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas(
gfx::Size(image_size + kDropArrowLeftMargin + drop_image->width(),
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 2df74e6..540180c 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -58,8 +58,8 @@ void IconLabelBubbleView::SetLabel(const string16& label) {
label_->SetText(label);
}
-void IconLabelBubbleView::SetImage(const SkBitmap& bitmap) {
- image_->SetImage(bitmap);
+void IconLabelBubbleView::SetImage(const gfx::ImageSkia& image_skia) {
+ image_->SetImage(image_skia);
}
void IconLabelBubbleView::OnPaint(gfx::Canvas* canvas) {
@@ -92,7 +92,7 @@ gfx::Size IconLabelBubbleView::GetNonLabelSize() const {
int IconLabelBubbleView::GetPreLabelWidth() const {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
return GetBubbleOuterPadding() +
- rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() +
+ rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)->width() +
LocationBarView::GetItemPadding();
}
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
index 0764c85..55f03f1 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
@@ -16,14 +16,14 @@
namespace gfx {
class Canvas;
class Font;
+class ImageSkia;
}
+
namespace views {
class ImageView;
class Label;
}
-class SkBitmap;
-
// View used to draw a bubble to the left of the address, containing an icon and
// a label. We use this as a base for the classes that handle the EV bubble and
// tab-to-search UI.
@@ -36,7 +36,7 @@ class IconLabelBubbleView : public views::View {
void SetFont(const gfx::Font& font);
void SetLabel(const string16& label);
- void SetImage(const SkBitmap& bitmap);
+ void SetImage(const gfx::ImageSkia& image);
void set_is_extension_icon(bool is_extension_icon) {
is_extension_icon_ = is_extension_icon;
}
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
index d514f94..686cc62 100644
--- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
+++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -15,25 +15,25 @@
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/views/controls/label.h"
// Amount of space to offset the tab image from the top of the view by.
static const int kTabImageYOffset = 4;
// The tab key image.
-static const SkBitmap* kTabButtonBitmap = NULL;
+static const gfx::ImageSkia* kTabButtonImage = NULL;
KeywordHintView::KeywordHintView(Profile* profile) : profile_(profile) {
leading_label_ = CreateLabel();
trailing_label_ = CreateLabel();
- if (!kTabButtonBitmap) {
+ if (!kTabButtonImage) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kTabButtonBitmap = rb.GetBitmapNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB);
+ kTabButtonImage = rb.GetImageSkiaNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB);
}
}
@@ -85,10 +85,10 @@ void KeywordHintView::OnPaint(gfx::Canvas* canvas) {
// is right-to-left.
gfx::Rect tab_button_bounds(image_x,
kTabImageYOffset,
- kTabButtonBitmap->width(),
- kTabButtonBitmap->height());
+ kTabButtonImage->width(),
+ kTabButtonImage->height());
tab_button_bounds.set_x(GetMirroredXForRect(tab_button_bounds));
- canvas->DrawBitmapInt(*kTabButtonBitmap,
+ canvas->DrawBitmapInt(*kTabButtonImage,
tab_button_bounds.x(),
tab_button_bounds.y());
}
@@ -98,7 +98,7 @@ gfx::Size KeywordHintView::GetPreferredSize() {
// added this should check baselines.
gfx::Size prefsize = leading_label_->GetPreferredSize();
int width = prefsize.width();
- width += kTabButtonBitmap->width();
+ width += kTabButtonImage->width();
prefsize = trailing_label_->GetPreferredSize();
width += prefsize.width();
return gfx::Size(width, prefsize.height());
@@ -107,12 +107,12 @@ gfx::Size KeywordHintView::GetPreferredSize() {
gfx::Size KeywordHintView::GetMinimumSize() {
// TODO(sky): currently height doesn't matter, once baseline support is
// added this should check baselines.
- return gfx::Size(kTabButtonBitmap->width(), 0);
+ return gfx::Size(kTabButtonImage->width(), 0);
}
void KeywordHintView::Layout() {
// TODO(sky): baseline layout.
- bool show_labels = (width() != kTabButtonBitmap->width());
+ bool show_labels = (width() != kTabButtonImage->width());
leading_label_->SetVisible(show_labels);
trailing_label_->SetVisible(show_labels);
@@ -123,7 +123,7 @@ void KeywordHintView::Layout() {
pref = leading_label_->GetPreferredSize();
leading_label_->SetBounds(x, 0, pref.width(), height());
- x += pref.width() + kTabButtonBitmap->width();
+ x += pref.width() + kTabButtonImage->width();
pref = trailing_label_->GetPreferredSize();
trailing_label_->SetBounds(x, 0, pref.width(), height());
}
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 0a5408f..96b3072 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -160,7 +160,7 @@ LocationBarView::LocationBarView(Profile* profile,
painter_.reset(
views::Painter::CreateImagePainter(
*ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_LOCATION_BAR_BORDER).ToSkBitmap(),
+ IDR_LOCATION_BAR_BORDER).ToImageSkia(),
gfx::Insets(kBorderRoundCornerHeight, kBorderRoundCornerWidth,
kBorderRoundCornerHeight, kBorderRoundCornerWidth),
true));
@@ -518,7 +518,7 @@ bool LocationBarView::IsLocationEntryFocusableInRootView() const {
}
gfx::Size LocationBarView::GetPreferredSize() {
- return gfx::Size(0, GetThemeProvider()->GetBitmapNamed(mode_ == POPUP ?
+ return gfx::Size(0, GetThemeProvider()->GetImageSkiaNamed(mode_ == POPUP ?
IDR_LOCATIONBG_POPUPMODE_CENTER : IDR_LOCATIONBG_C)->height());
}
@@ -781,7 +781,7 @@ void LocationBarView::OnPaint(gfx::Canvas* canvas) {
if (painter_.get()) {
painter_->Paint(canvas, size());
} else if (mode_ == POPUP) {
- canvas->TileImageInt(*GetThemeProvider()->GetBitmapNamed(
+ canvas->TileImageInt(*GetThemeProvider()->GetImageSkiaNamed(
IDR_LOCATIONBG_POPUPMODE_CENTER), 0, 0, 0, 0, width(), height());
}
// When used in the app launcher, don't draw a border, the LocationBarView has
diff --git a/chrome/browser/ui/views/menu_item_view_test.cc b/chrome/browser/ui/views/menu_item_view_test.cc
index 352f27f..d2f6c19 100644
--- a/chrome/browser/ui/views/menu_item_view_test.cc
+++ b/chrome/browser/ui/views/menu_item_view_test.cc
@@ -215,7 +215,7 @@ class MenuItemViewTestInsert : public MenuItemViewTestBase {
inserted_item_ = menu_->AddMenuItemAt(INSERT_INDEX,
1000,
ASCIIToUTF16("inserted item"),
- SkBitmap(),
+ gfx::ImageSkia(),
views::MenuItemView::NORMAL);
ASSERT_TRUE(inserted_item_);
menu_->ChildrenChanged();
@@ -325,7 +325,7 @@ class MenuItemViewTestInsertWithSubmenu : public MenuItemViewTestBase {
inserted_item_ = menu_->AddMenuItemAt(INSERT_INDEX,
1000,
ASCIIToUTF16("inserted item"),
- SkBitmap(),
+ gfx::ImageSkia(),
views::MenuItemView::NORMAL);
ASSERT_TRUE(inserted_item_);
menu_->ChildrenChanged();
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index 9644487..dc97e9b 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -390,9 +390,11 @@ void BalloonViewImpl::Show(Balloon* balloon) {
rb.GetImageSkiaNamed(IDR_TAB_CLOSE),
rb.GetImageSkiaNamed(IDR_TAB_CLOSE_MASK));
- options_menu_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH));
- options_menu_button_->SetHoverIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_H));
- options_menu_button_->SetPushedIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_P));
+ options_menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_BALLOON_WRENCH));
+ options_menu_button_->SetHoverIcon(
+ *rb.GetImageSkiaNamed(IDR_BALLOON_WRENCH_H));
+ options_menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed(
+ IDR_BALLOON_WRENCH_P));
options_menu_button_->set_alignment(views::TextButton::ALIGN_CENTER);
options_menu_button_->set_border(NULL);
options_menu_button_->SetBoundsRect(GetOptionsButtonBounds());
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc
index 5456668..c4e0bc7 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info_bubble_view.cc
@@ -55,7 +55,7 @@ class Section : public views::View,
public:
Section(PageInfoBubbleView* owner,
const PageInfoModel::SectionInfo& section_info,
- const SkBitmap* status_icon,
+ const gfx::ImageSkia* status_icon,
bool show_cert);
virtual ~Section();
@@ -191,7 +191,8 @@ void PageInfoBubbleView::LayoutSections() {
if (count == 1 && info.type == PageInfoModel::SECTION_INFO_INTERNAL_PAGE)
only_internal_section = true;
layout->StartRow(0, 0);
- const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap();
+ const gfx::ImageSkia* icon = model_.GetIconImage(
+ info.icon_id)->ToImageSkia();
Section* section = new Section(this, info, icon, cert_id_ > 0);
if (info.type == PageInfoModel::SECTION_INFO_FIRST_VISIT) {
// This section is animated into view, so we need to set the height of it
@@ -239,7 +240,8 @@ gfx::Size PageInfoBubbleView::GetPreferredSize() {
int count = model_.GetSectionCount();
for (int i = 0; i < count; ++i) {
PageInfoModel::SectionInfo info = model_.GetSectionInfo(i);
- const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap();
+ const gfx::ImageSkia* icon = model_.GetIconImage(
+ info.icon_id)->ToImageSkia();
Section section(this, info, icon, cert_id_ > 0);
size.Enlarge(0, section.GetHeightForWidth(size.width()));
}
@@ -313,7 +315,7 @@ void PageInfoBubbleView::AnimationProgressed(const ui::Animation* animation) {
Section::Section(PageInfoBubbleView* owner,
const PageInfoModel::SectionInfo& section_info,
- const SkBitmap* state_icon,
+ const gfx::ImageSkia* state_icon,
bool show_cert)
: owner_(owner),
info_(section_info),
diff --git a/chrome/browser/ui/views/speech_recognition_bubble_views.cc b/chrome/browser/ui/views/speech_recognition_bubble_views.cc
index 913b4ea..1a6f738 100644
--- a/chrome/browser/ui/views/speech_recognition_bubble_views.cc
+++ b/chrome/browser/ui/views/speech_recognition_bubble_views.cc
@@ -51,8 +51,8 @@ class SpeechRecognitionBubbleView
void UpdateLayout(SpeechRecognitionBubbleBase::DisplayMode mode,
const string16& message_text,
- const SkBitmap& image);
- void SetImage(const SkBitmap& image);
+ const gfx::ImageSkia& image);
+ void SetImage(const gfx::ImageSkia& image);
// views::BubbleDelegateView methods.
virtual void OnWidgetActivationChanged(views::Widget* widget,
@@ -109,7 +109,7 @@ SpeechRecognitionBubbleView::SpeechRecognitionBubbleView(
cancel_(NULL),
mic_settings_(NULL),
display_mode_(SpeechRecognitionBubbleBase::DISPLAY_MODE_WARM_UP),
- kIconLayoutMinWidth(ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ kIconLayoutMinWidth(ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_SPEECH_INPUT_MIC_EMPTY)->width()) {
// The bubble lifetime is managed by its controller; closing on escape or
// explicitly closing on deactivation will cause unexpected behavior.
@@ -175,7 +175,7 @@ void SpeechRecognitionBubbleView::Init() {
void SpeechRecognitionBubbleView::UpdateLayout(
SpeechRecognitionBubbleBase::DisplayMode mode,
const string16& message_text,
- const SkBitmap& image) {
+ const gfx::ImageSkia& image) {
display_mode_ = mode;
bool is_message = (mode == SpeechRecognitionBubbleBase::DISPLAY_MODE_MESSAGE);
icon_->SetVisible(!is_message);
@@ -210,7 +210,7 @@ void SpeechRecognitionBubbleView::UpdateLayout(
SizeToContents();
}
-void SpeechRecognitionBubbleView::SetImage(const SkBitmap& image) {
+void SpeechRecognitionBubbleView::SetImage(const gfx::ImageSkia& image) {
icon_->SetImage(image);
}
diff --git a/chrome/browser/ui/views/tab_icon_view.cc b/chrome/browser/ui/views/tab_icon_view.cc
index 748b3aa..800a163 100644
--- a/chrome/browser/ui/views/tab_icon_view.cc
+++ b/chrome/browser/ui/views/tab_icon_view.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "chrome/app/chrome_command_ids.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -26,7 +27,7 @@
#endif
static bool g_initialized = false;
-static SkBitmap* g_default_favicon = NULL;
+static gfx::ImageSkia* g_default_favicon = NULL;
// static
void TabIconView::InitializeIfNeeded() {
@@ -37,12 +38,13 @@ void TabIconView::InitializeIfNeeded() {
// The default window icon is the application icon, not the default
// favicon.
HICON app_icon = GetAppIcon();
- g_default_favicon =
- IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16));
+ scoped_ptr<SkBitmap> bitmap(
+ IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16)));
+ g_default_favicon = new gfx::ImageSkia(*bitmap);
DestroyIcon(app_icon);
#else
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- g_default_favicon = rb.GetBitmapNamed(IDR_PRODUCT_LOGO_16);
+ g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16);
#endif
}
}
@@ -63,8 +65,8 @@ void TabIconView::Update() {
static int throbber_frame_count = 0;
if (!initialized) {
initialized = true;
- SkBitmap throbber(
- *ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_THROBBER));
+ gfx::ImageSkia throbber(*ui::ResourceBundle::GetSharedInstance().
+ GetImageSkiaNamed(IDR_THROBBER));
throbber_frame_count = throbber.width() / throbber.height();
}
@@ -90,19 +92,19 @@ void TabIconView::Update() {
}
void TabIconView::PaintThrobber(gfx::Canvas* canvas) {
- SkBitmap throbber(*GetThemeProvider()->GetBitmapNamed(
+ gfx::ImageSkia throbber(*GetThemeProvider()->GetImageSkiaNamed(
is_light_ ? IDR_THROBBER_LIGHT : IDR_THROBBER));
int image_size = throbber.height();
PaintIcon(canvas, throbber, throbber_frame_ * image_size, 0, image_size,
image_size, false);
}
-void TabIconView::PaintFavicon(gfx::Canvas* canvas, const SkBitmap& bitmap) {
- PaintIcon(canvas, bitmap, 0, 0, bitmap.width(), bitmap.height(), true);
+void TabIconView::PaintFavicon(gfx::Canvas* canvas, const SkBitmap& image) {
+ PaintIcon(canvas, image, 0, 0, image.width(), image.height(), true);
}
void TabIconView::PaintIcon(gfx::Canvas* canvas,
- const SkBitmap& bitmap,
+ const gfx::ImageSkia& image,
int src_x,
int src_y,
int src_w,
@@ -128,7 +130,7 @@ void TabIconView::PaintIcon(gfx::Canvas* canvas,
int dest_h = static_cast<int>(float_src_h * scale);
// Center the scaled image.
- canvas->DrawBitmapInt(bitmap, src_x, src_y, src_w, src_h,
+ canvas->DrawBitmapInt(image, src_x, src_y, src_w, src_h,
(width() - dest_w) / 2, (height() - dest_h) / 2, dest_w,
dest_h, filter);
}
diff --git a/chrome/browser/ui/views/tab_icon_view.h b/chrome/browser/ui/views/tab_icon_view.h
index ffbc8c5..b807790 100644
--- a/chrome/browser/ui/views/tab_icon_view.h
+++ b/chrome/browser/ui/views/tab_icon_view.h
@@ -9,6 +9,8 @@
#include "base/compiler_specific.h"
#include "ui/views/view.h"
+class SkBitmap;
+
namespace gfx {
class ImageSkia;
}
@@ -49,7 +51,7 @@ class TabIconView : public views::View {
void PaintThrobber(gfx::Canvas* canvas);
void PaintFavicon(gfx::Canvas* canvas, const SkBitmap& bitmap);
void PaintIcon(gfx::Canvas* canvas,
- const SkBitmap& bitmap,
+ const gfx::ImageSkia& image,
int src_x,
int src_y,
int src_w,
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 7f87bae..34d7dca 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -93,7 +93,7 @@ namespace {
// Draws the icon image at the center of |bounds|.
void DrawIconCenter(gfx::Canvas* canvas,
- const SkBitmap& image,
+ const gfx::ImageSkia& image,
int image_offset,
int icon_width,
int icon_height,
@@ -422,10 +422,11 @@ void BaseTab::AdvanceLoadingAnimation(TabRendererData::NetworkState old_state,
if (!initialized) {
initialized = true;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- SkBitmap loading_animation(*rb.GetBitmapNamed(IDR_THROBBER));
+ gfx::ImageSkia loading_animation(*rb.GetImageSkiaNamed(IDR_THROBBER));
loading_animation_frame_count =
loading_animation.width() / loading_animation.height();
- SkBitmap waiting_animation(*rb.GetBitmapNamed(IDR_THROBBER_WAITING));
+ gfx::ImageSkia waiting_animation(*rb.GetImageSkiaNamed(
+ IDR_THROBBER_WAITING));
waiting_animation_frame_count =
waiting_animation.width() / waiting_animation.height();
waiting_to_loading_frame_count_ratio =
@@ -460,7 +461,7 @@ void BaseTab::PaintIcon(gfx::Canvas* canvas) {
if (data().network_state != TabRendererData::NETWORK_STATE_NONE) {
ui::ThemeProvider* tp = GetThemeProvider();
- SkBitmap frames(*tp->GetBitmapNamed(
+ gfx::ImageSkia frames(*tp->GetImageSkiaNamed(
(data().network_state == TabRendererData::NETWORK_STATE_WAITING) ?
IDR_THROBBER_WAITING : IDR_THROBBER));
@@ -473,7 +474,7 @@ void BaseTab::PaintIcon(gfx::Canvas* canvas) {
canvas->ClipRect(GetLocalBounds());
if (should_display_crashed_favicon_) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- SkBitmap crashed_favicon(*rb.GetBitmapNamed(IDR_SAD_FAVICON));
+ gfx::ImageSkia crashed_favicon(*rb.GetImageSkiaNamed(IDR_SAD_FAVICON));
bounds.set_y(bounds.y() + favicon_hiding_offset_);
DrawIconCenter(canvas, crashed_favicon, 0,
crashed_favicon.width(),
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 6cfd088..f95563f 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -244,7 +244,7 @@ gfx::Size Tab::GetBasicMinimumUnselectedSize() {
gfx::Size minimum_size;
minimum_size.set_width(left_padding() + right_padding());
- // Since we use bitmap images, the real minimum height of the image is
+ // Since we use image images, the real minimum height of the image is
// defined most accurately by the height of the end cap images.
minimum_size.set_height(tab_active_.image_l->height());
return minimum_size;
@@ -500,7 +500,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
gfx::Canvas background_canvas(size(), false);
PaintInactiveTabBackground(&background_canvas);
- SkBitmap background_image = background_canvas.ExtractBitmap();
+ gfx::ImageSkia background_image = background_canvas.ExtractBitmap();
// Draw a radial gradient to hover_canvas.
gfx::Canvas hover_canvas(size(), false);
@@ -529,7 +529,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
paint);
// Draw the radial gradient clipped to the background into hover_image.
- SkBitmap hover_image = SkBitmapOperations::CreateMaskedBitmap(
+ gfx::ImageSkia hover_image = SkBitmapOperations::CreateMaskedBitmap(
hover_canvas.ExtractBitmap(), background_image);
// Draw the tab background to the canvas.
@@ -559,7 +559,7 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
IDR_THEME_TAB_BACKGROUND;
}
- SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(tab_id);
+ gfx::ImageSkia* tab_bg = GetThemeProvider()->GetImageSkiaNamed(tab_id);
TabImage* tab_image = &tab_active_;
TabImage* tab_inactive_image = &tab_inactive_;
@@ -571,16 +571,16 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
int bg_offset_y = GetThemeProvider()->HasCustomImage(tab_id) ?
0 : background_offset_.y();
- // We need a gfx::Canvas object to be able to extract the bitmap from.
+ // We need a gfx::Canvas object to be able to extract the image from.
// We draw everything to this canvas and then output it to the canvas
// parameter in addition to using it to mask the hover glow if needed.
gfx::Canvas background_canvas(size(), false);
// Draw left edge. Don't draw over the toolbar, as we're not the foreground
// tab.
- SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
+ gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, bg_offset_y, tab_image->l_width, height());
- SkBitmap theme_l =
+ gfx::ImageSkia theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
background_canvas.DrawBitmapInt(theme_l,
0, 0, theme_l.width(), theme_l.height() - kToolbarOverlap,
@@ -588,10 +588,10 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
false);
// Draw right edge. Again, don't draw over the toolbar.
- SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, bg_offset_y,
tab_image->r_width, height());
- SkBitmap theme_r =
+ gfx::ImageSkia theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
background_canvas.DrawBitmapInt(theme_r,
0, 0, theme_r.width(), theme_r.height() - kToolbarOverlap,
@@ -632,22 +632,23 @@ void Tab::PaintActiveTabBackground(gfx::Canvas* canvas) {
ui::ThemeProvider* tp = GetThemeProvider();
DCHECK(tp) << "Unable to get theme provider";
- SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR);
+ gfx::ImageSkia* tab_bg =
+ GetThemeProvider()->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
TabImage* tab_image = &tab_active_;
TabImage* alpha = &tab_alpha_;
// Draw left edge.
- SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
+ gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, 0, tab_image->l_width, height());
- SkBitmap theme_l =
+ gfx::ImageSkia theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
canvas->DrawBitmapInt(theme_l, 0, 0);
// Draw right edge.
- SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, 0, tab_image->r_width, height());
- SkBitmap theme_r =
+ gfx::ImageSkia theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
canvas->DrawBitmapInt(theme_r, width() - tab_image->r_width, 0);
@@ -728,18 +729,18 @@ void Tab::LoadTabImages() {
// We're not letting people override tab images just yet.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- tab_alpha_.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_LEFT);
- tab_alpha_.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_RIGHT);
+ tab_alpha_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_LEFT);
+ tab_alpha_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_RIGHT);
- tab_active_.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT);
- tab_active_.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER);
- tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT);
+ tab_active_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_LEFT);
+ tab_active_.image_c = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_CENTER);
+ tab_active_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT);
tab_active_.l_width = tab_active_.image_l->width();
tab_active_.r_width = tab_active_.image_r->width();
- tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
- tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
- tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
+ tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT);
+ tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER);
+ tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT);
tab_inactive_.l_width = tab_inactive_.image_l->width();
tab_inactive_.r_width = tab_inactive_.image_r->width();
}
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h
index 15f5831..85787fc 100644
--- a/chrome/browser/ui/views/tabs/tab.h
+++ b/chrome/browser/ui/views/tabs/tab.h
@@ -117,9 +117,9 @@ class Tab : public BaseTab {
scoped_ptr<ui::MultiAnimation> mini_title_animation_;
struct TabImage {
- SkBitmap* image_l;
- SkBitmap* image_c;
- SkBitmap* image_r;
+ gfx::ImageSkia* image_l;
+ gfx::ImageSkia* image_c;
+ gfx::ImageSkia* image_r;
int l_width;
int r_width;
int y_offset;
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index c3e7ea9..dce441c 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -31,13 +31,13 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "grit/theme_resources.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/animation/animation.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/events.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
#include "ui/views/events/event.h"
#include "ui/views/widget/root_view.h"
@@ -106,8 +106,8 @@ class DockView : public views::View {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- SkBitmap* high_icon = rb.GetBitmapNamed(IDR_DOCK_HIGH);
- SkBitmap* wide_icon = rb.GetBitmapNamed(IDR_DOCK_WIDE);
+ gfx::ImageSkia* high_icon = rb.GetImageSkiaNamed(IDR_DOCK_HIGH);
+ gfx::ImageSkia* wide_icon = rb.GetImageSkiaNamed(IDR_DOCK_WIDE);
canvas->Save();
bool rtl_ui = base::i18n::IsRTL();
@@ -126,8 +126,8 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*high_icon, x_of_active_tab,
(height() - high_icon->height()) / 2);
if (type_ == DockInfo::LEFT_OF_WINDOW) {
- DrawBitmapWithAlpha(canvas, *high_icon, x_of_inactive_tab,
- (height() - high_icon->height()) / 2);
+ DrawImageWithAlpha(canvas, *high_icon, x_of_inactive_tab,
+ (height() - high_icon->height()) / 2);
}
break;
@@ -139,8 +139,8 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*high_icon, x_of_active_tab,
(height() - high_icon->height()) / 2);
if (type_ == DockInfo::RIGHT_OF_WINDOW) {
- DrawBitmapWithAlpha(canvas, *high_icon, x_of_inactive_tab,
- (height() - high_icon->height()) / 2);
+ DrawImageWithAlpha(canvas, *high_icon, x_of_inactive_tab,
+ (height() - high_icon->height()) / 2);
}
break;
@@ -150,7 +150,7 @@ class DockView : public views::View {
break;
case DockInfo::MAXIMIZE: {
- SkBitmap* max_icon = rb.GetBitmapNamed(IDR_DOCK_MAX);
+ gfx::ImageSkia* max_icon = rb.GetImageSkiaNamed(IDR_DOCK_MAX);
canvas->DrawBitmapInt(*max_icon, (width() - max_icon->width()) / 2,
(height() - max_icon->height()) / 2);
break;
@@ -161,7 +161,7 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*wide_icon, (width() - wide_icon->width()) / 2,
height() / 2 + kTabSpacing / 2);
if (type_ == DockInfo::BOTTOM_OF_WINDOW) {
- DrawBitmapWithAlpha(canvas, *wide_icon,
+ DrawImageWithAlpha(canvas, *wide_icon,
(width() - wide_icon->width()) / 2,
height() / 2 - kTabSpacing / 2 - wide_icon->height());
}
@@ -175,8 +175,8 @@ class DockView : public views::View {
}
private:
- void DrawBitmapWithAlpha(gfx::Canvas* canvas, const SkBitmap& image,
- int x, int y) {
+ void DrawImageWithAlpha(gfx::Canvas* canvas, const gfx::ImageSkia& image,
+ int x, int y) {
SkPaint paint;
paint.setAlpha(128);
canvas->DrawBitmapInt(image, x, y, paint);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 9b09e1e..610db93 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -32,13 +32,13 @@
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
+#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/path.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
#include "ui/gfx/skbitmap_operations.h"
-#include "ui/base/layout.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/mouse_watcher_view_host.h"
#include "ui/views/view_model_utils.h"
@@ -324,10 +324,10 @@ void NewTabButton::GetHitTestMask(gfx::Path* path) const {
SkScalar w = SkIntToScalar(width());
- // These values are defined by the shape of the new tab bitmap. Should that
- // bitmap ever change, these values will need to be updated. They're so
+ // These values are defined by the shape of the new tab image. Should that
+ // image ever change, these values will need to be updated. They're so
// custom it's not really worth defining constants for.
- // These values are correct for regular and USE_ASH versions of the bitmap.
+ // These values are correct for regular and USE_ASH versions of the image.
path->moveTo(0, 1);
path->lineTo(w - 7, 1);
path->lineTo(w - 4, 4);
@@ -353,8 +353,8 @@ void NewTabButton::OnMouseReleased(const views::MouseEvent& event) {
#endif
void NewTabButton::OnPaint(gfx::Canvas* canvas) {
- SkBitmap bitmap = GetBitmap();
- canvas->DrawBitmapInt(bitmap, 0, height() - bitmap.height());
+ SkBitmap image = GetBitmap();
+ canvas->DrawBitmapInt(image, 0, height() - image.height());
}
bool NewTabButton::ShouldUseNativeFrame() const {
@@ -386,14 +386,16 @@ SkBitmap NewTabButton::GetBackgroundBitmap(
break;
}
- SkBitmap* mask = GetThemeProvider()->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
+ gfx::ImageSkia* mask =
+ GetThemeProvider()->GetImageSkiaNamed(IDR_NEWTAB_BUTTON_MASK);
int height = mask->height();
int width = mask->width();
gfx::Canvas canvas(gfx::Size(width, height), false);
// For custom images the background starts at the top of the tab strip.
// Otherwise the background starts at the top of the frame.
- SkBitmap* background = GetThemeProvider()->GetBitmapNamed(background_id);
+ gfx::ImageSkia* background =
+ GetThemeProvider()->GetImageSkiaNamed(background_id);
int offset_y = GetThemeProvider()->HasCustomImage(background_id) ?
0 : background_offset_.y();
canvas.TileImageInt(*background, GetMirroredX() + background_offset_.x(),
@@ -418,7 +420,7 @@ SkBitmap NewTabButton::GetBitmapForState(
views::CustomButton::ButtonState state) const {
int overlay_id = state == views::CustomButton::BS_PUSHED ?
IDR_NEWTAB_BUTTON_P : IDR_NEWTAB_BUTTON;
- SkBitmap* overlay = GetThemeProvider()->GetBitmapNamed(overlay_id);
+ gfx::ImageSkia* overlay = GetThemeProvider()->GetImageSkiaNamed(overlay_id);
gfx::Canvas canvas(gfx::Size(overlay->width(), overlay->height()), false);
canvas.DrawBitmapInt(GetBackgroundBitmap(state), 0, 0);
diff --git a/chrome/browser/ui/views/theme_background.cc b/chrome/browser/ui/views/theme_background.cc
index 52f3f1d..6cb8404 100644
--- a/chrome/browser/ui/views/theme_background.cc
+++ b/chrome/browser/ui/views/theme_background.cc
@@ -21,25 +21,25 @@ ThemeBackground::ThemeBackground(BrowserView* browser_view)
}
void ThemeBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
- SkBitmap* background;
+ gfx::ImageSkia* background;
// Never theme app and popup windows.
if (!browser_view_->IsBrowserTypeNormal()) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (browser_view_->IsActive())
- background = rb.GetBitmapNamed(IDR_FRAME);
+ background = rb.GetImageSkiaNamed(IDR_FRAME);
else
- background = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
+ background = rb.GetImageSkiaNamed(IDR_THEME_FRAME_INACTIVE);
} else {
Profile* profile = browser_view_->browser()->profile();
ui::ThemeProvider* theme = ThemeServiceFactory::GetForProfile(profile);
if (browser_view_->IsActive()) {
- background = theme->GetBitmapNamed(
+ background = theme->GetImageSkiaNamed(
profile->IsOffTheRecord() ?
IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME);
} else {
- background = theme->GetBitmapNamed(
+ background = theme->GetImageSkiaNamed(
profile->IsOffTheRecord() ?
IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE);
}
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 8c9a979..b53dab9 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -80,7 +80,7 @@ const int kPopupBottomSpacingGlass = 1;
// corner of the wrench menu).
const int kBadgeTopMargin = 2;
-SkBitmap* kPopupBackgroundEdge = NULL;
+gfx::ImageSkia* kPopupBackgroundEdge = NULL;
// The omnibox border has some additional shadow, so we use less vertical
// spacing than ToolbarView::kVertSpacing.
@@ -137,7 +137,7 @@ ToolbarView::ToolbarView(Browser* browser)
if (!kPopupBackgroundEdge) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kPopupBackgroundEdge = rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_EDGE);
+ kPopupBackgroundEdge = rb.GetImageSkiaNamed(IDR_LOCATIONBG_POPUPMODE_EDGE);
}
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
@@ -275,7 +275,8 @@ void ToolbarView::RemoveMenuListener(views::MenuListener* listener) {
menu_listeners_.RemoveObserver(listener);
}
-SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
+gfx::ImageSkia ToolbarView::GetAppMenuIcon(
+ views::CustomButton::ButtonState state) {
ui::ThemeProvider* tp = GetThemeProvider();
int id = 0;
@@ -285,7 +286,7 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
case views::CustomButton::BS_PUSHED: id = IDR_TOOLS_P; break;
default: NOTREACHED(); break;
}
- SkBitmap icon = *tp->GetBitmapNamed(id);
+ gfx::ImageSkia icon = *tp->GetImageSkiaNamed(id);
#if defined(OS_WIN)
// Keep track of whether we were showing the badge before, so we don't send
@@ -307,24 +308,24 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
// Draw the chrome app menu icon onto the canvas.
scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas(icon, false));
- SkBitmap badge;
+ gfx::ImageSkia badge;
// Only one badge can be active at any given time. The Upgrade notification
// is deemed most important, then the DLL conflict badge.
if (ShouldShowUpgradeRecommended()) {
- badge = *tp->GetBitmapNamed(
+ badge = *tp->GetImageSkiaNamed(
UpgradeDetector::GetInstance()->GetIconResourceID(
UpgradeDetector::UPGRADE_ICON_TYPE_BADGE));
} else if (ShouldShowIncompatibilityWarning()) {
#if defined(OS_WIN)
if (!was_showing)
content::RecordAction(UserMetricsAction("ConflictBadge"));
- badge = *tp->GetBitmapNamed(IDR_CONFLICT_BADGE);
+ badge = *tp->GetImageSkiaNamed(IDR_CONFLICT_BADGE);
incompatibility_badge_showing = true;
#else
NOTREACHED();
#endif
} else if (error_badge_id) {
- badge = *tp->GetBitmapNamed(error_badge_id);
+ badge = *tp->GetImageSkiaNamed(error_badge_id);
} else {
NOTREACHED();
}
@@ -541,10 +542,10 @@ gfx::Size ToolbarView::GetPreferredSize() {
browser_actions_->GetPreferredSize().width() +
app_menu_->GetPreferredSize().width() + kRightEdgeSpacing;
- CR_DEFINE_STATIC_LOCAL(SkBitmap, normal_background, ());
+ CR_DEFINE_STATIC_LOCAL(gfx::ImageSkia, normal_background, ());
if (normal_background.isNull()) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- normal_background = *rb.GetBitmapNamed(IDR_CONTENT_TOP_CENTER);
+ normal_background = *rb.GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER);
}
return gfx::Size(min_width,
diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h
index d77f4e1..d3e67bc 100644
--- a/chrome/browser/ui/views/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar_view.h
@@ -69,9 +69,9 @@ class ToolbarView : public views::AccessiblePaneView,
// Remove a menu listener.
void RemoveMenuListener(views::MenuListener* listener);
- // Gets a bitmap with the icon for the app menu and any overlaid notification
+ // Gets an image with the icon for the app menu and any overlaid notification
// badge.
- SkBitmap GetAppMenuIcon(views::CustomButton::ButtonState state);
+ gfx::ImageSkia GetAppMenuIcon(views::CustomButton::ButtonState state);
virtual bool GetAcceleratorInfo(int id, ui::Accelerator* accel);
@@ -182,7 +182,7 @@ class ToolbarView : public views::AccessiblePaneView,
// Gets a badge for the wrench icon corresponding to the number of
// unacknowledged background pages in the system.
- SkBitmap GetBackgroundPageBadge();
+ gfx::ImageSkia GetBackgroundPageBadge();
scoped_ptr<BackForwardMenuModel> back_menu_model_;
scoped_ptr<BackForwardMenuModel> forward_menu_model_;
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index 2f79470..df4118a 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -212,7 +212,8 @@ void NTPLoginHandler::UpdateLogin() {
const gfx::Image* image =
cache.GetGAIAPictureOfProfileAtIndex(profile_index);
if (image)
- icon_url = web_ui_util::GetImageDataUrl(GetGAIAPictureForNTP(*image));
+ icon_url = web_ui_util::GetImageDataUrl(gfx::ImageSkia(
+ GetGAIAPictureForNTP(*image)));
}
if (header.empty())
header = CreateSpanWithClass(UTF8ToUTF16(username), "profile-name");
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
index 511af7d..195f8a2 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
@@ -16,8 +16,8 @@
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
-#include "base/values.h"
#include "base/value_conversions.h"
+#include "base/values.h"
#include "chrome/browser/auto_launch_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_page_zoom.h"
@@ -87,7 +87,7 @@
#include "chrome/browser/chromeos/options/take_photo_dialog.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/webui/options2/chromeos/system_settings_provider2.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
#endif // defined(OS_CHROMEOS)
#if defined(OS_WIN)
@@ -912,7 +912,7 @@ scoped_ptr<ListValue> BrowserOptionsHandler::GetProfilesInfoList() {
gfx::Image icon = profiles::GetAvatarIconForWebUI(
cache.GetAvatarIconOfProfileAtIndex(i), true);
profile_value->SetString("iconURL",
- web_ui_util::GetImageDataUrl(*icon.ToSkBitmap()));
+ web_ui_util::GetImageDataUrl(*icon.ToImageSkia()));
} else {
size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(i);
profile_value->SetString("iconURL",
diff --git a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
index ade3ca7..3ede790 100644
--- a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
+++ b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
@@ -108,7 +108,7 @@ void ManageProfileHandler::SendProfileIcons() {
cache.GetGAIAPictureOfProfileAtIndex(profile_index);
if (icon) {
gfx::Image icon2 = profiles::GetAvatarIconForWebUI(*icon, true);
- gaia_picture_url_ = web_ui_util::GetImageDataUrl(*icon2.ToSkBitmap());
+ gaia_picture_url_ = web_ui_util::GetImageDataUrl(*icon2.ToImageSkia());
image_url_list.Append(Value::CreateStringValue(gaia_picture_url_));
}
}
@@ -268,7 +268,7 @@ void ManageProfileHandler::RequestProfileInfo(const ListValue* args) {
gfx::Image icon = profiles::GetAvatarIconForWebUI(
cache.GetAvatarIconOfProfileAtIndex(index), true);
profile_value.SetString("iconURL",
- web_ui_util::GetImageDataUrl(*icon.ToSkBitmap()));
+ web_ui_util::GetImageDataUrl(*icon.ToImageSkia()));
} else {
size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
profile_value.SetString("iconURL",
diff --git a/chrome/browser/ui/webui/task_manager/task_manager_handler.cc b/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
index 8c3404b..35e0ce5 100644
--- a/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
+++ b/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
@@ -20,7 +20,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
#include "webkit/glue/webpreferences.h"
namespace {
diff --git a/chrome/browser/ui/webui/web_ui_util.cc b/chrome/browser/ui/webui/web_ui_util.cc
index 46d2824..160ba0a 100644
--- a/chrome/browser/ui/webui/web_ui_util.cc
+++ b/chrome/browser/ui/webui/web_ui_util.cc
@@ -14,12 +14,13 @@
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
+#include "ui/gfx/image/image_skia.h"
namespace web_ui_util {
-std::string GetImageDataUrl(const SkBitmap& bitmap) {
+std::string GetImageDataUrl(const gfx::ImageSkia& image) {
std::vector<unsigned char> output;
- gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &output);
+ gfx::PNGCodec::EncodeBGRASkBitmap(*image.bitmap(), false, &output);
std::string str_url;
str_url.insert(str_url.end(), output.begin(), output.end());
diff --git a/chrome/browser/ui/webui/web_ui_util.h b/chrome/browser/ui/webui/web_ui_util.h
index 99a2b46..5a5e6d2 100644
--- a/chrome/browser/ui/webui/web_ui_util.h
+++ b/chrome/browser/ui/webui/web_ui_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,13 +11,15 @@
#include "base/values.h"
#include "webkit/glue/window_open_disposition.h"
-class SkBitmap;
+namespace gfx {
+class ImageSkia;
+}
namespace web_ui_util {
-// Convenience routine to convert SkBitmap object to data url
+// Convenience routine to convert ImageSkia object to data url
// so that it can be used in WebUI.
-std::string GetImageDataUrl(const SkBitmap& bitmap);
+std::string GetImageDataUrl(const gfx::ImageSkia& image);
// Convenience routine to get data url that corresponds to given
// resource_id as an image. This function does not check if the