diff options
Diffstat (limited to 'chrome/browser/ui')
21 files changed, 103 insertions, 85 deletions
diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm index ae379ef..879d901 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm @@ -42,6 +42,7 @@ #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/image/image_skia.h" namespace { // Colors for the infobar. @@ -407,12 +408,12 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { true)); // Convert the model's icons from Skia to Cocoa. - std::vector<SkBitmap> skiaIcons; + std::vector<gfx::ImageSkia> skiaIcons; allowedTreeModel_->GetIcons(&skiaIcons); icons_.reset([[NSMutableArray alloc] init]); - for (std::vector<SkBitmap>::iterator it = skiaIcons.begin(); + for (std::vector<gfx::ImageSkia>::iterator it = skiaIcons.begin(); it != skiaIcons.end(); ++it) { - [icons_ addObject:gfx::SkBitmapToNSImage(*it)]; + [icons_ addObject:gfx::SkBitmapToNSImage(*it->bitmap())]; } // Default icon will be the last item in the array. diff --git a/chrome/browser/ui/cocoa/menu_controller.mm b/chrome/browser/ui/cocoa/menu_controller.mm index 2cb6a60..8de231b 100644 --- a/chrome/browser/ui/cocoa/menu_controller.mm +++ b/chrome/browser/ui/cocoa/menu_controller.mm @@ -12,6 +12,7 @@ #include "ui/base/accelerators/accelerator_cocoa.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/models/simple_menu_model.h" +#include "ui/gfx/image/image_skia.h" @interface MenuController (Private) - (void)addSeparatorToMenu:(NSMenu*)menu @@ -106,9 +107,9 @@ keyEquivalent:@""]); // If the menu item has an icon, set it. - SkBitmap skiaIcon; + gfx::ImageSkia skiaIcon; if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull()) { - NSImage* icon = gfx::SkBitmapToNSImage(skiaIcon); + NSImage* icon = gfx::SkBitmapToNSImage(*skiaIcon.bitmap()); if (icon) { [item setImage:icon]; } @@ -165,10 +166,10 @@ NSString* label = l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex)); [(id)item setTitle:label]; - SkBitmap skiaIcon; + gfx::ImageSkia skiaIcon; NSImage* icon = nil; if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull()) - icon = gfx::SkBitmapToNSImage(skiaIcon); + icon = gfx::SkBitmapToNSImage(*skiaIcon.bitmap()); [(id)item setImage:icon]; } return model->IsEnabledAt(modelIndex); diff --git a/chrome/browser/ui/cocoa/menu_controller_unittest.mm b/chrome/browser/ui/cocoa/menu_controller_unittest.mm index d838531..6d9a792 100644 --- a/chrome/browser/ui/cocoa/menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/menu_controller_unittest.mm @@ -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. @@ -14,6 +14,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/image/image_skia.h" class MenuControllerTest : public CocoaTest { }; @@ -75,7 +76,7 @@ class DynamicDelegate : public Delegate { DynamicDelegate() : icon_(NULL) {} virtual bool IsItemForCommandIdDynamic(int command_id) const { return true; } virtual string16 GetLabelForCommandId(int command_id) const { return label_; } - virtual bool GetIconForCommandId(int command_id, SkBitmap* icon) const { + virtual bool GetIconForCommandId(int command_id, gfx::ImageSkia* icon) const { if (icon_) { *icon = *icon_; return true; diff --git a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm index 97a6e52..396d9ab 100644 --- a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm @@ -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. @@ -12,6 +12,7 @@ #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" #include "skia/ext/skia_utils_mac.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/image/image_skia.h" using base::SysUTF16ToNSString; using gfx::SkBitmapToNSImage; @@ -71,10 +72,10 @@ using gfx::SkBitmapToNSImage; keyEquivalent:@""]; [menuItem autorelease]; - SkBitmap icon; + gfx::ImageSkia icon; // Icon (if it has one). if (model_->GetIconAt(menuID, &icon)) - [menuItem setImage:SkBitmapToNSImage(icon)]; + [menuItem setImage:SkBitmapToNSImage(*icon.bitmap())]; // This will make it call our |-executeMenuItem:| method. We store the // |menuID| (or |menu_id|) in the tag. diff --git a/chrome/browser/ui/gtk/gtk_tree.cc b/chrome/browser/ui/gtk/gtk_tree.cc index 6c9d6dc..5f1fa24 100644 --- a/chrome/browser/ui/gtk/gtk_tree.cc +++ b/chrome/browser/ui/gtk/gtk_tree.cc @@ -11,6 +11,7 @@ #include "ui/base/models/table_model.h" #include "ui/gfx/gtk_util.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/image/image_skia.h" namespace gtk_tree { @@ -351,10 +352,10 @@ TreeAdapter::TreeAdapter(Delegate* delegate, ui::TreeModel* tree_model) G_TYPE_POINTER); tree_model->AddObserver(this); - std::vector<SkBitmap> icons; + std::vector<gfx::ImageSkia> icons; tree_model->GetIcons(&icons); for (size_t i = 0; i < icons.size(); ++i) { - pixbufs_.push_back(gfx::GdkPixbufFromSkBitmap(icons[i])); + pixbufs_.push_back(gfx::GdkPixbufFromSkBitmap(*icons[i].bitmap())); } } diff --git a/chrome/browser/ui/gtk/menu_gtk.cc b/chrome/browser/ui/gtk/menu_gtk.cc index b58abe8..4d9ad42 100644 --- a/chrome/browser/ui/gtk/menu_gtk.cc +++ b/chrome/browser/ui/gtk/menu_gtk.cc @@ -445,7 +445,7 @@ void MenuGtk::BuildSubmenuFromModel(ui::MenuModel* model, GtkWidget* menu) { std::map<int, GtkWidget*> radio_groups; GtkWidget* menu_item = NULL; for (int i = 0; i < model->GetItemCount(); ++i) { - SkBitmap icon; + gfx::ImageSkia icon; std::string label = ui::ConvertAcceleratorsFromWindowsStyle( UTF16ToUTF8(model->GetLabelAt(i))); bool connect_to_activate = true; @@ -876,7 +876,7 @@ void MenuGtk::SetMenuItemInfo(GtkWidget* widget, gpointer userdata) { gtk_menu_item_set_label(GTK_MENU_ITEM(widget), label.c_str()); if (GTK_IS_IMAGE_MENU_ITEM(widget)) { - SkBitmap icon; + gfx::ImageSkia icon; if (model->GetIconAt(id, &icon)) { GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(icon); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(widget), 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 8ba1e88..662c910c 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.cc +++ b/chrome/browser/ui/search_engines/template_url_table_model.cc @@ -20,6 +20,7 @@ #include "ui/base/models/table_model_observer.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/codec/png_codec.h" +#include "ui/gfx/image/image_skia.h" // Group IDs used by TemplateURLTableModel. static const int kMainGroupID = 0; @@ -49,7 +50,7 @@ class ModelEntry { return template_url_; } - SkBitmap GetIcon() { + gfx::ImageSkia GetIcon() { if (load_state_ == NOT_LOADED) LoadFavicon(); if (!favicon_.isNull()) @@ -193,7 +194,7 @@ string16 TemplateURLTableModel::GetText(int row, int col_id) { return base::i18n::GetDisplayStringInLTRDirectionality(url->keyword()); } -SkBitmap TemplateURLTableModel::GetIcon(int row) { +gfx::ImageSkia TemplateURLTableModel::GetIcon(int row) { DCHECK(row >= 0 && row < RowCount()); return entries_[row]->GetIcon(); } 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 3ee549b..78dcb43 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.h +++ b/chrome/browser/ui/search_engines/template_url_table_model.h @@ -19,6 +19,10 @@ class SkBitmap; class TemplateURL; class TemplateURLService; +namespace gfx { +class ImageSkia; +} + // TemplateURLTableModel is the TableModel implementation used by // KeywordEditorView to show the keywords in a TableView. // @@ -45,7 +49,7 @@ class TemplateURLTableModel : public ui::TableModel, // ui::TableModel overrides. virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column) OVERRIDE; - virtual SkBitmap GetIcon(int row) OVERRIDE; + virtual gfx::ImageSkia GetIcon(int row) OVERRIDE; virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual bool HasGroups() OVERRIDE; virtual Groups GetGroups() OVERRIDE; diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index de085cf..c719308 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -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. @@ -131,12 +131,12 @@ int BackForwardMenuModel::GetGroupIdAt(int index) const { return false; } -bool BackForwardMenuModel::GetIconAt(int index, SkBitmap* icon) { +bool BackForwardMenuModel::GetIconAt(int index, gfx::ImageSkia* icon) { if (!ItemHasIcon(index)) return false; if (index == GetItemCount() - 1) { - *icon = *ResourceBundle::GetSharedInstance().GetBitmapNamed( + *icon = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_HISTORY_FAVICON); } else { NavigationEntry* entry = GetNavigationEntry(index); diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.h b/chrome/browser/ui/toolbar/back_forward_menu_model.h index 0c8cf54..03c13f5 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.h +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.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. @@ -17,13 +17,16 @@ #include "webkit/glue/window_open_disposition.h" class Browser; -class SkBitmap; namespace content { class NavigationEntry; class WebContents; } +namespace gfx { +class ImageSkia; +} + /////////////////////////////////////////////////////////////////////////////// // // BackForwardMenuModel @@ -58,7 +61,7 @@ class BackForwardMenuModel : public ui::MenuModel { ui::Accelerator* accelerator) const OVERRIDE; virtual bool IsItemCheckedAt(int index) const OVERRIDE; virtual int GetGroupIdAt(int index) const OVERRIDE; - virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE; + virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE; virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( int index) const OVERRIDE; virtual bool IsEnabledAt(int index) const OVERRIDE; diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc index cb8e775..6eb5b68 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc @@ -509,9 +509,9 @@ TEST_F(BackFwdMenuModelTest, FaviconLoadTest) { back_model.set_test_web_contents(controller().GetWebContents()); back_model.SetMenuModelDelegate(&favicon_delegate); - SkBitmap new_icon(CreateBitmap(SK_ColorRED)); + SkBitmap new_icon_bitmap(CreateBitmap(SK_ColorRED)); std::vector<unsigned char> icon_data; - gfx::PNGCodec::EncodeBGRASkBitmap(new_icon, false, &icon_data); + gfx::PNGCodec::EncodeBGRASkBitmap(new_icon_bitmap, false, &icon_data); GURL url1 = GURL("http://www.a.com/1"); GURL url2 = GURL("http://www.a.com/2"); @@ -529,7 +529,7 @@ TEST_F(BackFwdMenuModelTest, FaviconLoadTest) { // Will return the current icon (default) but start an anync call // to retrieve the favicon from the favicon service. - SkBitmap default_icon; + gfx::ImageSkia default_icon; back_model.GetIconAt(0, &default_icon); // Make the favicon service run GetFavIconForURL, @@ -540,22 +540,27 @@ TEST_F(BackFwdMenuModelTest, FaviconLoadTest) { EXPECT_TRUE(favicon_delegate.was_called()); // Verify the bitmaps match. - SkBitmap valid_icon; + gfx::ImageSkia valid_icon; // This time we will get the new favicon returned. back_model.GetIconAt(0, &valid_icon); - SkAutoLockPixels a(new_icon); - SkAutoLockPixels b(valid_icon); - SkAutoLockPixels c(default_icon); + + SkBitmap default_icon_bitmap = *default_icon.bitmap(); + SkBitmap valid_icon_bitmap = *valid_icon.bitmap(); + + SkAutoLockPixels a(new_icon_bitmap); + SkAutoLockPixels b(valid_icon_bitmap); + SkAutoLockPixels c(default_icon_bitmap); // Verify we did not get the default favicon. - EXPECT_NE(0, memcmp(default_icon.getPixels(), valid_icon.getPixels(), - default_icon.getSize())); + EXPECT_NE(0, memcmp(default_icon_bitmap.getPixels(), + valid_icon_bitmap.getPixels(), + default_icon_bitmap.getSize())); // Verify we did get the expected favicon. - EXPECT_EQ(0, memcmp(new_icon.getPixels(), valid_icon.getPixels(), - new_icon.getSize())); + EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), + valid_icon_bitmap.getPixels(), + new_icon_bitmap.getSize())); // Make sure the browser deconstructor doesn't have problems. browser.CloseAllTabs(); // This is required to prevent the message loop from hanging. profile()->DestroyHistoryService(); } - diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 6dd6b56..11ac89d 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -281,14 +281,14 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const { } bool WrenchMenuModel::GetIconForCommandId(int command_id, - SkBitmap* icon) const { + gfx::ImageSkia* icon) const { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); switch (command_id) { case IDC_UPGRADE_DIALOG: { if (UpgradeDetector::GetInstance()->notify_upgrade()) { - *icon = *rb.GetNativeImageNamed( + *icon = *rb.GetImageNamed( UpgradeDetector::GetInstance()->GetIconResourceID( - UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON)).ToSkBitmap(); + UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON)).ToImageSkia(); return true; } return false; @@ -301,7 +301,7 @@ bool WrenchMenuModel::GetIconForCommandId(int command_id, if (error && error->HasCustomizedSyncMenuItem()) { int icon_id = error->MenuItemIconResourceID(); if (icon_id) { - *icon = *rb.GetNativeImageNamed(icon_id).ToSkBitmap(); + *icon = *rb.GetImageNamed(icon_id).ToImageSkia(); return true; } } diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h index 445223a..ccde76a 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.h +++ b/chrome/browser/ui/toolbar/wrench_menu_model.h @@ -88,7 +88,7 @@ class WrenchMenuModel : public ui::SimpleMenuModel, virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; virtual bool GetIconForCommandId(int command_id, - SkBitmap* icon) const OVERRIDE; + gfx::ImageSkia* icon) const OVERRIDE; virtual void ExecuteCommand(int command_id) OVERRIDE; virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index bcd3e91..3e8428c 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -84,7 +84,7 @@ class HungPagesTableModel : public views::GroupTableModel { // Overridden from views::GroupTableModel: virtual int RowCount(); virtual string16 GetText(int row, int column_id); - virtual SkBitmap GetIcon(int row); + virtual gfx::ImageSkia GetIcon(int row); virtual void SetObserver(ui::TableModelObserver* observer); virtual void GetGroupRangeForItem(int item, views::GroupRange* range); @@ -188,7 +188,7 @@ string16 HungPagesTableModel::GetText(int row, int column_id) { return title; } -SkBitmap HungPagesTableModel::GetIcon(int row) { +gfx::ImageSkia HungPagesTableModel::GetIcon(int row) { DCHECK(row >= 0 && row < RowCount()); return tab_observers_[row]->favicon_tab_helper()->GetFavicon(); } diff --git a/chrome/browser/ui/views/infobars/infobar_button_border.cc b/chrome/browser/ui/views/infobars/infobar_button_border.cc index d7998b1..45fc88f 100644 --- a/chrome/browser/ui/views/infobars/infobar_button_border.cc +++ b/chrome/browser/ui/views/infobars/infobar_button_border.cc @@ -14,41 +14,41 @@ InfoBarButtonBorder::InfoBarButtonBorder() { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); BorderImageSet normal_set = { - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_N).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_N).ToSkBitmap(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_N).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_N).ToImageSkia(), }; set_normal_set(normal_set); BorderImageSet hot_set = { - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_H).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_H).ToSkBitmap(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_H).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_H).ToImageSkia(), }; set_hot_set(hot_set); BorderImageSet pushed_set = { - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_P).ToSkBitmap(), - rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_P).ToSkBitmap(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_LEFT_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_TOP_RIGHT_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_LEFT_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_CENTER_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_RIGHT_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_LEFT_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_P).ToImageSkia(), + rb.GetImageNamed(IDR_INFOBARBUTTON_BOTTOM_RIGHT_P).ToImageSkia(), }; set_pushed_set(pushed_set); } diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index 9b7b9fe..0563e1f 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc @@ -104,7 +104,7 @@ views::MenuButton* InfoBarView::CreateMenuButton( menu_button->set_animate_on_state_change(false); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); menu_button->set_menu_marker( - rb.GetImageNamed(IDR_INFOBARBUTTON_MENU_DROPARROW).ToSkBitmap()); + rb.GetImageNamed(IDR_INFOBARBUTTON_MENU_DROPARROW).ToImageSkia()); menu_button->SetEnabledColor(SK_ColorBLACK); menu_button->SetHighlightColor(SK_ColorBLACK); menu_button->SetHoverColor(SK_ColorBLACK); diff --git a/chrome/browser/ui/views/menu_model_adapter_test.cc b/chrome/browser/ui/views/menu_model_adapter_test.cc index 0ec3eb9..74371a8 100644 --- a/chrome/browser/ui/views/menu_model_adapter_test.cc +++ b/chrome/browser/ui/views/menu_model_adapter_test.cc @@ -143,7 +143,7 @@ class CommonMenuModel : public ui::MenuModel { return 0; } - virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE { + virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE { return false; } diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index bd56df4..b110211 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -67,7 +67,7 @@ class TaskManagerTableModel : public views::GroupTableModel, // GroupTableModel. int RowCount() OVERRIDE; string16 GetText(int row, int column) OVERRIDE; - SkBitmap GetIcon(int row) OVERRIDE; + gfx::ImageSkia GetIcon(int row) OVERRIDE; void GetGroupRangeForItem(int item, views::GroupRange* range) OVERRIDE; void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; @@ -163,7 +163,7 @@ string16 TaskManagerTableModel::GetText(int row, int col_id) { } } -SkBitmap TaskManagerTableModel::GetIcon(int row) { +gfx::ImageSkia TaskManagerTableModel::GetIcon(int row) { return model_->GetResourceIcon(row); } diff --git a/chrome/browser/ui/views/web_intent_picker_views.cc b/chrome/browser/ui/views/web_intent_picker_views.cc index 2a5e35b..5de1d08 100644 --- a/chrome/browser/ui/views/web_intent_picker_views.cc +++ b/chrome/browser/ui/views/web_intent_picker_views.cc @@ -144,20 +144,20 @@ class ThrobberNativeTextButton : public views::NativeTextButton { void StopThrobber(); // Set the throbber bitmap to use. IDR_THROBBER is used by default. - void SetFrames(const SkBitmap* frames); + void SetFrames(const gfx::ImageSkia* frames); protected: - virtual const SkBitmap& GetImageToPaint() const OVERRIDE; + virtual const gfx::ImageSkia& GetImageToPaint() const OVERRIDE; private: // The timer callback to schedule painting this view. void Run(); - // Bitmap that contains the throbber frames. - const SkBitmap* frames_; + // Image that contains the throbber frames. + const gfx::ImageSkia* frames_; // The currently displayed frame, given to GetImageToPaint. - mutable SkBitmap this_frame_; + mutable gfx::ImageSkia this_frame_; // How long one frame is displayed. base::TimeDelta frame_time_; @@ -184,7 +184,7 @@ ThrobberNativeTextButton::ThrobberNativeTextButton( frame_count_(0), running_(false) { SetFrames(ui::ResourceBundle::GetSharedInstance().GetImageNamed( - IDR_THROBBER).ToSkBitmap()); + IDR_THROBBER).ToImageSkia()); } ThrobberNativeTextButton::~ThrobberNativeTextButton() { @@ -210,7 +210,7 @@ void ThrobberNativeTextButton::StopThrobber() { running_ = false; } -void ThrobberNativeTextButton::SetFrames(const SkBitmap* frames) { +void ThrobberNativeTextButton::SetFrames(const gfx::ImageSkia* frames) { frames_ = frames; DCHECK(frames_->width() > 0 && frames_->height() > 0); DCHECK(frames_->width() % frames_->height() == 0); @@ -218,7 +218,7 @@ void ThrobberNativeTextButton::SetFrames(const SkBitmap* frames) { PreferredSizeChanged(); } -const SkBitmap& ThrobberNativeTextButton::GetImageToPaint() const { +const gfx::ImageSkia& ThrobberNativeTextButton::GetImageToPaint() const { if (!running_) return NativeTextButton::GetImageToPaint(); diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc index b624a33..88d9a1f 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -929,7 +929,7 @@ MenuItemView* WrenchMenu::AppendMenuItem(MenuItemView* parent, menu_item->SetVisible(model->IsVisibleAt(index)); if (menu_type == MenuModel::TYPE_COMMAND && model->HasIcons()) { - SkBitmap icon; + gfx::ImageSkia icon; if (model->GetIconAt(index, &icon)) menu_item->SetIcon(icon); } diff --git a/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc b/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc index cfb2a1b..cad8a9b 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc +++ b/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc @@ -74,7 +74,7 @@ base::ListValue* NetworkMenuWebUI::ConvertMenuModel(ui::MenuModel* model) { base::DictionaryValue* item = new base::DictionaryValue(); item->SetInteger("id", id); item->SetString("label", model->GetLabelAt(i)); - SkBitmap icon; + gfx::ImageSkia icon; if (model->GetIconAt(i, &icon)) item->SetString("icon", web_ui_util::GetImageDataUrl(icon)); if (id >= 0) { |
