| Index: ash/system/web_notification/web_notification_tray.cc
|
| diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
|
| index bce9b2e2bba95b295d749ade53dd256dd1d9394b..9a761d8a79d04c867964c1b809d57e4491a60bcf 100644
|
| --- a/ash/system/web_notification/web_notification_tray.cc
|
| +++ b/ash/system/web_notification/web_notification_tray.cc
|
| @@ -16,6 +16,7 @@
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/models/simple_menu_model.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/gfx/image/image_skia_operations.h"
|
| #include "ui/views/controls/button/button.h"
|
| #include "ui/views/controls/button/menu_button.h"
|
| #include "ui/views/controls/button/menu_button_listener.h"
|
| @@ -54,17 +55,15 @@ const int kToggleExtensionCommand = 1;
|
| const int kShowSettingsCommand = 2;
|
|
|
| // The image has three icons: 1 notifiaction, 2 notifications, and 3+.
|
| -SkBitmap GetNotificationImage(int notification_count) {
|
| - SkBitmap image;
|
| - gfx::Image all = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| - IDR_AURA_UBER_TRAY_WEB_NOTIFICATON);
|
| +gfx::ImageSkia GetNotificationImage(int notification_count) {
|
| + const gfx::ImageSkia* image = ui::ResourceBundle::GetSharedInstance().
|
| + GetImageSkiaNamed(IDR_AURA_UBER_TRAY_WEB_NOTIFICATON);
|
| int image_index = notification_count - 1;
|
| image_index = std::max(0, std::min(image_index, 2));
|
| - SkIRect region = SkIRect::MakeXYWH(
|
| + gfx::Rect region(
|
| 0, image_index * kNotificationImageIconHeight,
|
| kNotificationImageIconWidth, kNotificationImageIconHeight);
|
| - all.ToSkBitmap()->extractSubset(&image, region);
|
| - return image;
|
| + return gfx::ImageSkiaOperations::ExtractSubset(*image, region);
|
| }
|
|
|
| } // namespace
|
| @@ -830,7 +829,7 @@ void WebNotificationTray::UpdateIcon() {
|
| status_area_widget_->login_status() == user::LOGGED_IN_LOCKED) {
|
| SetVisible(false);
|
| } else {
|
| - icon_->SetImage(gfx::ImageSkia(GetNotificationImage(count)));
|
| + icon_->SetImage(GetNotificationImage(count));
|
| SetVisible(true);
|
| }
|
| PreferredSizeChanged();
|
|
|