Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2579)

Unified Diff: ash/common/system/web_notification/web_notification_tray.cc

Issue 2324913002: Updates to shelf icons for Ash material design (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/web_notification/web_notification_tray.cc
diff --git a/ash/common/system/web_notification/web_notification_tray.cc b/ash/common/system/web_notification/web_notification_tray.cc
index fd478d7e85cc96dd8841088add0f8886e3ed2b90..4b54b2897531b5c6ee1e05ecf0c3183468b12719 100644
--- a/ash/common/system/web_notification/web_notification_tray.cc
+++ b/ash/common/system/web_notification/web_notification_tray.cc
@@ -21,6 +21,7 @@
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/resources/vector_icons/vector_icons.h"
#include "base/auto_reset.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
@@ -68,7 +69,7 @@ constexpr int kEnableQuietModeDay = 2;
constexpr int kMaximumSmallIconCount = 3;
constexpr gfx::Size kTrayItemInnerIconSize(16, 16);
-constexpr gfx::Size kTrayItemInnerBellIconSize(18, 18);
+constexpr gfx::Size kTrayItemInnerBellIconSizeNonMd(18, 18);
constexpr gfx::Size kTrayItemOuterSize(26, 26);
constexpr gfx::Insets kTrayItemInsets(3, 3);
@@ -306,17 +307,18 @@ WebNotificationTray::WebNotificationTray(WmShelf* shelf,
DCHECK(status_area_window_);
DCHECK(system_tray_);
+ const bool md_shelf = MaterialDesignController::IsShelfMaterial();
gfx::ImageSkia bell_image;
- if (MaterialDesignController::IsShelfMaterial()) {
- bell_image = CreateVectorIcon(gfx::VectorIconId::SHELF_NOTIFICATIONS,
- kShelfIconColor);
+ if (md_shelf) {
+ bell_image = CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor);
Evan Stade 2016/09/09 20:39:56 ternary operator?
tdanderson 2016/09/09 21:15:10 Done.
} else {
bell_image =
CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize,
kWebNotificationColorNoUnread);
}
- bell_icon_.reset(new WebNotificationImage(bell_image,
- kTrayItemInnerBellIconSize,
+ const gfx::Size bell_icon_size =
+ md_shelf ? kTrayItemInnerIconSize : kTrayItemInnerBellIconSizeNonMd;
+ bell_icon_.reset(new WebNotificationImage(bell_image, bell_icon_size,
animation_container_.get(), this));
tray_container()->AddChildView(bell_icon_.get());

Powered by Google App Engine
This is Rietveld 408576698