diff options
34 files changed, 80 insertions, 74 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc index 616c196..5e78220 100644 --- a/chrome/browser/alternate_nav_url_fetcher.cc +++ b/chrome/browser/alternate_nav_url_fetcher.cc @@ -98,8 +98,8 @@ void AlternateNavURLFetcher::OnURLFetchComplete( ShowInfobarIfPossible(); } -SkBitmap* AlternateNavURLFetcher::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* AlternateNavURLFetcher::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_ALT_NAV_URL); } diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h index 14bd13b..1f06b9a 100644 --- a/chrome/browser/alternate_nav_url_fetcher.h +++ b/chrome/browser/alternate_nav_url_fetcher.h @@ -58,7 +58,7 @@ class AlternateNavURLFetcher : public NotificationObserver, const std::string& data); // LinkInfoBarDelegate - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageTextWithOffset(size_t* link_offset) const; virtual string16 GetLinkText() const; diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index f10d5ab..9d37e64 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -57,8 +57,8 @@ void AutofillCCInfoBarDelegate::InfoBarDismissed() { LogUserAction(AutofillMetrics::CREDIT_CARD_INFOBAR_DENIED); } -SkBitmap* AutofillCCInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* AutofillCCInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_AUTOFILL); } diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h index 1c4fa77..1ff3576 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h @@ -39,7 +39,7 @@ class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { const NavigationController::LoadCommittedDetails& details) const; virtual void InfoBarClosed(); virtual void InfoBarDismissed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; diff --git a/chrome/browser/download/download_request_infobar_delegate.cc b/chrome/browser/download/download_request_infobar_delegate.cc index a4a8693..d7372af 100644 --- a/chrome/browser/download/download_request_infobar_delegate.cc +++ b/chrome/browser/download/download_request_infobar_delegate.cc @@ -26,8 +26,8 @@ void DownloadRequestInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* DownloadRequestInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* DownloadRequestInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_MULTIPLE_DOWNLOADS); } diff --git a/chrome/browser/download/download_request_infobar_delegate.h b/chrome/browser/download/download_request_infobar_delegate.h index aa5a789..81a9898 100644 --- a/chrome/browser/download/download_request_infobar_delegate.h +++ b/chrome/browser/download/download_request_infobar_delegate.h @@ -31,7 +31,7 @@ class DownloadRequestInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; virtual bool Accept(); diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index e6aa111..822f42e 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -67,10 +67,11 @@ void ThemeInstalledInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* ThemeInstalledInfoBarDelegate::GetIcon() const { +gfx::Image* ThemeInstalledInfoBarDelegate::GetIcon() const { // TODO(aa): Reply with the theme's icon, but this requires reading it // asynchronously from disk. - return ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_INFOBAR_THEME); + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( + IDR_INFOBAR_THEME); } ThemeInstalledInfoBarDelegate* diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.h b/chrome/browser/extensions/theme_installed_infobar_delegate.h index 072a572..b21395f 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.h +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.h @@ -38,7 +38,7 @@ class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate, private: // ConfirmInfoBarDelegate: virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); virtual string16 GetMessageText() const; virtual int GetButtons() const; diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index f9ce488..71d03d6 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -126,7 +126,7 @@ class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; @@ -173,8 +173,8 @@ void GeolocationConfirmInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* GeolocationConfirmInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_GEOLOCATION_INFOBAR_ICON); } diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index 8b8bde6..bd68c39 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -102,7 +102,7 @@ class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; @@ -165,8 +165,8 @@ void NotificationPermissionInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* NotificationPermissionInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* NotificationPermissionInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_PRODUCT_ICON_32); } diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc index 32d13de..f85ee51 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -59,7 +59,7 @@ class HintInfoBar : public ConfirmInfoBarDelegate { const NavigationController::LoadCommittedDetails& details) const; virtual void InfoBarDismissed(); virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual int GetButtons() const; @@ -115,8 +115,8 @@ void HintInfoBar::InfoBarClosed() { delete this; } -SkBitmap* HintInfoBar::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* HintInfoBar::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_QUESTION_MARK); } diff --git a/chrome/browser/password_manager_delegate_impl.cc b/chrome/browser/password_manager_delegate_impl.cc index 0762288..239959a 100644 --- a/chrome/browser/password_manager_delegate_impl.cc +++ b/chrome/browser/password_manager_delegate_impl.cc @@ -42,7 +42,7 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; @@ -76,8 +76,8 @@ void SavePasswordInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* SavePasswordInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* SavePasswordInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_SAVE_PASSWORD); } diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc index 2fbb5d6..2eac72e 100644 --- a/chrome/browser/plugin_installer_infobar_delegate.cc +++ b/chrome/browser/plugin_installer_infobar_delegate.cc @@ -21,8 +21,8 @@ PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate( PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { } -SkBitmap* PluginInstallerInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* PluginInstallerInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_PLUGIN_INSTALL); } diff --git a/chrome/browser/plugin_installer_infobar_delegate.h b/chrome/browser/plugin_installer_infobar_delegate.h index 66e1893..a04bcac 100644 --- a/chrome/browser/plugin_installer_infobar_delegate.h +++ b/chrome/browser/plugin_installer_infobar_delegate.h @@ -20,7 +20,7 @@ class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate { virtual ~PluginInstallerInfoBarDelegate(); // ConfirmInfoBarDelegate: - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual PluginInstallerInfoBarDelegate* AsPluginInstallerInfoBarDelegate(); virtual string16 GetMessageText() const; virtual int GetButtons() const; diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc index 6d8779f..a985f8f 100644 --- a/chrome/browser/plugin_observer.cc +++ b/chrome/browser/plugin_observer.cc @@ -49,7 +49,7 @@ class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { private: // ConfirmInfoBarDelegate: - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual string16 GetLinkText(); DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate); @@ -80,8 +80,8 @@ bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { return false; } -SkBitmap* PluginInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* PluginInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_PLUGIN_INSTALL); } @@ -351,10 +351,10 @@ void PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) { plugin_name.erase(plugin_name.length() - kPluginExtension.length()); #endif // OS_MACOSX } - SkBitmap* crash_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( + gfx::Image* icon = &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_PLUGIN_CRASHED); tab_contents()->AddInfoBar(new SimpleAlertInfoBarDelegate(tab_contents(), - crash_icon, + icon, l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, plugin_name), true)); } diff --git a/chrome/browser/tab_contents/infobar_delegate.cc b/chrome/browser/tab_contents/infobar_delegate.cc index ec77e24..7b4720e 100644 --- a/chrome/browser/tab_contents/infobar_delegate.cc +++ b/chrome/browser/tab_contents/infobar_delegate.cc @@ -32,7 +32,7 @@ void InfoBarDelegate::InfoBarDismissed() { void InfoBarDelegate::InfoBarClosed() { } -SkBitmap* InfoBarDelegate::GetIcon() const { +gfx::Image* InfoBarDelegate::GetIcon() const { return NULL; } diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 8310d9f..4ee29c4 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -16,10 +16,13 @@ class ExtensionInfoBarDelegate; class InfoBar; class LinkInfoBarDelegate; class PluginInstallerInfoBarDelegate; -class SkBitmap; class ThemeInstalledInfoBarDelegate; class TranslateInfoBarDelegate; +namespace gfx { +class Image; +} + // An interface implemented by objects wishing to control an InfoBar. // Implementing this interface is not sufficient to use an InfoBar, since it // does not map to a specific InfoBar type. Instead, you must implement either @@ -78,9 +81,9 @@ class InfoBarDelegate { // at this point. virtual void InfoBarClosed(); - // Return the icon to be shown for this InfoBar. If the returned bitmap is + // Return the icon to be shown for this InfoBar. If the returned Image is // NULL, no icon is shown. - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; // Returns the type of the infobar. The type determines the appearance (such // as background color) of the infobar. diff --git a/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc b/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc index 9d1dd04..28220be 100644 --- a/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc +++ b/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc @@ -10,7 +10,7 @@ SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( TabContents* contents, - SkBitmap* icon, + gfx::Image* icon, const string16& message, bool auto_expire) : ConfirmInfoBarDelegate(contents), @@ -31,7 +31,7 @@ void SimpleAlertInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* SimpleAlertInfoBarDelegate::GetIcon() const { +gfx::Image* SimpleAlertInfoBarDelegate::GetIcon() const { return icon_; } diff --git a/chrome/browser/tab_contents/simple_alert_infobar_delegate.h b/chrome/browser/tab_contents/simple_alert_infobar_delegate.h index 5a696d4c..1ef2539 100644 --- a/chrome/browser/tab_contents/simple_alert_infobar_delegate.h +++ b/chrome/browser/tab_contents/simple_alert_infobar_delegate.h @@ -17,7 +17,7 @@ class TabContents; class SimpleAlertInfoBarDelegate : public ConfirmInfoBarDelegate { public: SimpleAlertInfoBarDelegate(TabContents* contents, - SkBitmap* icon, // May be NULL. + gfx::Image* icon, // May be NULL. const string16& message, bool auto_expire); @@ -28,11 +28,11 @@ class SimpleAlertInfoBarDelegate : public ConfirmInfoBarDelegate { virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const OVERRIDE; virtual void InfoBarClosed() OVERRIDE; - virtual SkBitmap* GetIcon() const OVERRIDE; + virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - SkBitmap* icon_; + gfx::Image* icon_; string16 message_; bool auto_expire_; // Should it expire automatically on navigation? diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc index 5702760..fb99bf6 100644 --- a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc +++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc @@ -24,9 +24,9 @@ namespace { -SkBitmap* GetCertIcon() { +gfx::Image* GetCertIcon() { // TODO(davidben): use a more appropriate icon. - return ResourceBundle::GetSharedInstance().GetBitmapNamed( + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_SAVE_PASSWORD); } @@ -43,7 +43,7 @@ class SSLCertAddedInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual int GetButtons() const; @@ -70,7 +70,7 @@ void SSLCertAddedInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* SSLCertAddedInfoBarDelegate::GetIcon() const { +gfx::Image* SSLCertAddedInfoBarDelegate::GetIcon() const { return GetCertIcon(); } diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index 1835872..ab848eb 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -363,8 +363,8 @@ void TranslateInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* TranslateInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* TranslateInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_TRANSLATE); } diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h index 69401a0..9d763089 100644 --- a/chrome/browser/translate/translate_infobar_delegate.h +++ b/chrome/browser/translate/translate_infobar_delegate.h @@ -162,7 +162,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { virtual InfoBar* CreateInfoBar(); virtual void InfoBarDismissed(); virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual InfoBarDelegate::Type GetInfoBarType() const; virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index 71cd400..25188f4 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -144,7 +144,7 @@ class DefaultBrowserInfoBarDelegate : public ConfirmInfoBarDelegate { virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const OVERRIDE; virtual void InfoBarClosed() OVERRIDE; - virtual SkBitmap* GetIcon() const OVERRIDE; + virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool NeedElevation(InfoBarButton button) const OVERRIDE; @@ -194,8 +194,8 @@ void DefaultBrowserInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* DefaultBrowserInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_PRODUCT_ICON_32); } @@ -305,7 +305,7 @@ class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual void InfoBarClosed() OVERRIDE; - virtual SkBitmap* GetIcon() const OVERRIDE; + virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; @@ -330,8 +330,8 @@ void SessionCrashedInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* SessionCrashedInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* SessionCrashedInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_RESTORE_SESSION); } diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm index 32b8688..67fbbd7 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm @@ -17,12 +17,13 @@ #include "chrome/common/extensions/extension_action.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/image.h" // When an extension is installed on Mac with neither browser action nor // page action icons, show an infobar instead of a popup bubble. static void ShowGenericExtensionInstalledInfoBar( const Extension* new_extension, - SkBitmap icon, + const SkBitmap& icon, Profile* profile) { Browser* browser = BrowserList::GetLastActiveWithProfile(profile); if (!browser) @@ -40,7 +41,7 @@ static void ShowGenericExtensionInstalledInfoBar( UTF8ToUTF16(" ") + l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC); InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate(tab_contents, - new SkBitmap(icon), msg, true); + new gfx::Image(new SkBitmap(icon)), msg, true); tab_contents->AddInfoBar(delegate); } diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm index dd9725c..d45447f 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm @@ -14,8 +14,8 @@ #include "chrome/browser/ui/cocoa/infobars/infobar.h" #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" -#include "skia/ext/skia_utils_mac.h" #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" +#include "ui/gfx/image.h" #include "webkit/glue/window_open_disposition.h" namespace { @@ -113,7 +113,7 @@ const float kAnimateCloseDuration = 0.12; - (void)awakeFromNib { DCHECK(delegate_); if (delegate_->GetIcon()) { - [image_ setImage:gfx::SkBitmapToNSImage(*(delegate_->GetIcon()))]; + [image_ setImage:*(delegate_->GetIcon())]; } else { // No icon, remove it from the view and grow the textfield to include the // space. 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 e5a75e1..6cc13bf 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc +++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc @@ -28,7 +28,7 @@ void MockConfirmInfoBarDelegate::InfoBarClosed() { closed_ = true; } -SkBitmap* MockConfirmInfoBarDelegate::GetIcon() const { +gfx::Image* MockConfirmInfoBarDelegate::GetIcon() const { icon_accessed_ = true; return NULL; } diff --git a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h index 7e7539a..7a05597 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h +++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h @@ -32,7 +32,7 @@ class MockConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { private: // ConfirmInfoBarDelegate: virtual void InfoBarClosed() OVERRIDE; - virtual SkBitmap* GetIcon() const OVERRIDE; + virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; 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 51bc760..8c7d4f6 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc +++ b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc @@ -27,7 +27,7 @@ void MockLinkInfoBarDelegate::InfoBarClosed() { closed_ = true; } -SkBitmap* MockLinkInfoBarDelegate::GetIcon() const { +gfx::Image* MockLinkInfoBarDelegate::GetIcon() const { icon_accessed_ = true; return NULL; } diff --git a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h index ace696c..a4f6ff7 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h +++ b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h @@ -31,7 +31,7 @@ class MockLinkInfoBarDelegate : public LinkInfoBarDelegate { private: // LinkInfoBarDelegate: virtual void InfoBarClosed() OVERRIDE; - virtual SkBitmap* GetIcon() const OVERRIDE; + virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageTextWithOffset(size_t* link_offset) const OVERRIDE; virtual string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; diff --git a/chrome/browser/ui/cocoa/keystone_infobar.mm b/chrome/browser/ui/cocoa/keystone_infobar.mm index 19f1bab..d218199 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar.mm @@ -49,7 +49,7 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate { virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const; virtual void InfoBarClosed(); - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual string16 GetMessageText() const; virtual string16 GetButtonLabel(InfoBarButton button) const; virtual bool Accept(); @@ -92,8 +92,8 @@ void KeystonePromotionInfoBarDelegate::InfoBarClosed() { delete this; } -SkBitmap* KeystonePromotionInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( +gfx::Image* KeystonePromotionInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_PRODUCT_ICON_32); } diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.cc b/chrome/browser/ui/collected_cookies_infobar_delegate.cc index 0f1d279..7e4ae76 100644 --- a/chrome/browser/ui/collected_cookies_infobar_delegate.cc +++ b/chrome/browser/ui/collected_cookies_infobar_delegate.cc @@ -17,8 +17,9 @@ CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate( tab_contents_(tab_contents) { } -SkBitmap* CollectedCookiesInfoBarDelegate::GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_INFOBAR_COOKIE); +gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const { + return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( + IDR_INFOBAR_COOKIE); } InfoBarDelegate::Type CollectedCookiesInfoBarDelegate::GetInfoBarType() const { diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.h b/chrome/browser/ui/collected_cookies_infobar_delegate.h index 8e76221..b9be902 100644 --- a/chrome/browser/ui/collected_cookies_infobar_delegate.h +++ b/chrome/browser/ui/collected_cookies_infobar_delegate.h @@ -18,7 +18,7 @@ class CollectedCookiesInfoBarDelegate : public ConfirmInfoBarDelegate { private: // ConfirmInfoBarDelegate overrides. - virtual SkBitmap* GetIcon() const; + virtual gfx::Image* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; virtual int GetButtons() const; diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc index 453db8a..7ed9022 100644 --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc @@ -16,6 +16,7 @@ #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" #include "content/common/notification_service.h" #include "ui/gfx/gtk_util.h" +#include "ui/gfx/image.h" extern const int InfoBar::kInfoBarHeight = 37; @@ -61,11 +62,9 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) gtk_widget_set_size_request(bg_box_, -1, kInfoBarHeight); // Add the icon on the left, if any. - SkBitmap* icon = delegate->GetIcon(); + gfx::Image* icon = delegate->GetIcon(); if (icon) { - GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(icon); - GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); - g_object_unref(pixbuf); + GtkWidget* image = gtk_image_new_from_pixbuf(*icon); // All icons should be 26x26, but some are larger with transparent padding // pixels around the edges. (And some are smaller). Thus we hardcode the diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index d10bb36..73af43d 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc @@ -17,6 +17,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia_paint.h" +#include "ui/gfx/image.h" #include "views/controls/button/image_button.h" #include "views/controls/button/menu_button.h" #include "views/controls/button/text_button.h" @@ -225,10 +226,10 @@ void InfoBarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { } if (close_button_ == NULL) { - SkBitmap* image = delegate()->GetIcon(); + gfx::Image* image = delegate()->GetIcon(); if (image) { icon_ = new views::ImageView; - icon_->SetImage(image); + icon_->SetImage(*image); AddChildView(icon_); } |