diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 13:29:10 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 13:29:10 +0000 |
commit | d3ae860c873949a15d5dfd929eab28460e5d531e (patch) | |
tree | 3f50b68a285ba62b1f1ae31cdfc8df0bdf46049f /chrome | |
parent | 9b7b57dffdf12effc49a259da5ec9e71668d3608 (diff) | |
download | chromium_src-d3ae860c873949a15d5dfd929eab28460e5d531e.zip chromium_src-d3ae860c873949a15d5dfd929eab28460e5d531e.tar.gz chromium_src-d3ae860c873949a15d5dfd929eab28460e5d531e.tar.bz2 |
ui/gfx: Remove the deprecated "operator const SkBitmap*" from Image API.
BUG=58030
R=rsesek@chromium.org
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9718024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
6 files changed, 25 insertions, 28 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 551bc2b..ab1bb68 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -375,7 +375,7 @@ void DragDownload(const DownloadItem* download, if (icon) { drag_utils::CreateDragImageForFile( - download->GetFileNameToReportUser(), *icon, &data); + download->GetFileNameToReportUser(), icon->ToSkBitmap(), &data); } const FilePath full_path = download->GetFullPath(); diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc index 71135a7..1eda4a6 100644 --- a/chrome/browser/first_run/try_chrome_dialog_view.cc +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc @@ -64,7 +64,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( ResourceBundle& rb = ResourceBundle::GetSharedInstance(); views::ImageView* icon = new views::ImageView(); - icon->SetImage(*rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32)); + icon->SetImage(rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32).ToSkBitmap()); gfx::Size icon_size = icon->GetPreferredSize(); // An approximate window size. After Layout() we'll get better bounds. @@ -159,11 +159,11 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( // The close button is custom. views::ImageButton* close_button = new views::ImageButton(this); close_button->SetImage(views::CustomButton::BS_NORMAL, - rb.GetNativeImageNamed(IDR_CLOSE_BAR)); + rb.GetNativeImageNamed(IDR_CLOSE_BAR).ToSkBitmap()); close_button->SetImage(views::CustomButton::BS_HOT, - rb.GetNativeImageNamed(IDR_CLOSE_BAR_H)); + rb.GetNativeImageNamed(IDR_CLOSE_BAR_H).ToSkBitmap()); close_button->SetImage(views::CustomButton::BS_PUSHED, - rb.GetNativeImageNamed(IDR_CLOSE_BAR_P)); + rb.GetNativeImageNamed(IDR_CLOSE_BAR_P).ToSkBitmap()); close_button->set_tag(BT_CLOSE_BUTTON); layout->AddView(close_button); diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 2edf646..fac66f6 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc @@ -502,12 +502,10 @@ SkBitmap* BrowserThemePack::GetBitmapNamed(int idr_id) const { if (!image) return NULL; - const SkBitmap* bitmap = *image; - // TODO(sail): This cast should be removed. Currently we use this const_cast // to avoid changing the BrowserThemePack::GetBitmapNamed API. Once we // switch to using gfx::Image everywhere this can be removed. - return const_cast<SkBitmap*>(bitmap); + return const_cast<SkBitmap*>(image->ToSkBitmap()); } const gfx::Image* BrowserThemePack::GetImageNamed(int idr_id) const { @@ -1002,7 +1000,7 @@ void BrowserThemePack::GenerateTabBackgroundImages(ImageCache* bitmaps) const { // If they've provided a custom image, overlay it. ImageCache::const_iterator overlay_it = bitmaps->find(prs_id); if (overlay_it != bitmaps->end()) { - const SkBitmap* overlay = *(overlay_it->second); + const SkBitmap* overlay = overlay_it->second->ToSkBitmap(); SkCanvas canvas(*bg_tab); for (int x = 0; x < bg_tab->width(); x += overlay->width()) canvas.drawBitmap(*overlay, static_cast<SkScalar>(x), 0, NULL); diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index 4c20aa9..7e86498 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc @@ -837,7 +837,7 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) { if (IsShowingWarningDialog()) icon = warning_icon_; else if (image) - icon = *image; + icon = image->ToSkBitmap(); // 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 diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc index 9316a89..2491ea0 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc @@ -55,16 +55,16 @@ class AppNonClientFrameViewAura::ControlView restore_button_->SetAccessibleName( l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE)); - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); int control_base_resource_id = owner->browser_view()->IsOffTheRecord() ? IDR_AURA_WINDOW_HEADER_BASE_INCOGNITO_ACTIVE : IDR_AURA_WINDOW_HEADER_BASE_ACTIVE; - control_base_ = *rb.GetImageNamed(control_base_resource_id); + control_base_ = rb.GetImageNamed(control_base_resource_id).ToSkBitmap(); separator_ = - *rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SEPARATOR).ToSkBitmap(); - shadow_ = *rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SHADOW).ToSkBitmap(); + rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SEPARATOR).ToSkBitmap(); + shadow_ = rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SHADOW).ToSkBitmap(); AddChildView(close_button_); AddChildView(restore_button_); @@ -72,9 +72,8 @@ class AppNonClientFrameViewAura::ControlView virtual void Layout() OVERRIDE { restore_button_->SetPosition(gfx::Point(kShadowStart, 0)); - close_button_->SetPosition( - gfx::Point(kShadowStart + restore_button_->width() + separator_.width(), - 0)); + close_button_->SetPosition(gfx::Point(kShadowStart + + restore_button_->width() + separator_->width(), 0)); } virtual void ViewHierarchyChanged(bool is_add, View* parent, @@ -95,12 +94,12 @@ class AppNonClientFrameViewAura::ControlView } virtual gfx::Size GetPreferredSize() OVERRIDE { - return gfx::Size(shadow_.width() + kShadowWidthStretch, - shadow_.height() + kShadowHeightStretch); + return gfx::Size(shadow_->width() + kShadowWidthStretch, + shadow_->height() + kShadowHeightStretch); } virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { - canvas->TileImageInt(control_base_, + canvas->TileImageInt(*control_base_, restore_button_->x(), restore_button_->y(), restore_button_->width() + close_button_->width(), @@ -108,9 +107,9 @@ class AppNonClientFrameViewAura::ControlView views::View::OnPaint(canvas); - canvas->DrawBitmapInt( - separator_, restore_button_->x() + restore_button_->width(), 0); - canvas->DrawBitmapInt(shadow_, 0, kShadowHeightStretch); + canvas->DrawBitmapInt(*separator_, + restore_button_->x() + restore_button_->width(), 0); + canvas->DrawBitmapInt(*shadow_, 0, kShadowHeightStretch); } void ButtonPressed( @@ -141,9 +140,9 @@ class AppNonClientFrameViewAura::ControlView AppNonClientFrameViewAura* owner_; views::ImageButton* close_button_; views::ImageButton* restore_button_; - SkBitmap control_base_; - SkBitmap separator_; - SkBitmap shadow_; + const SkBitmap* control_base_; + const SkBitmap* separator_; + const SkBitmap* shadow_; DISALLOW_COPY_AND_ASSIGN(ControlView); }; diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc index ca717432..c41e106 100644 --- a/chrome/browser/ui/views/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info_bubble_view.cc @@ -196,7 +196,7 @@ 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); + const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap(); 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 @@ -244,7 +244,7 @@ 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); + const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap(); Section section(this, info, icon, cert_id_ > 0); size.Enlarge(0, section.GetHeightForWidth(size.width())); } |