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

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

Issue 2324913002: Updates to shelf icons for Ash material design (Closed)
Patch Set: Evan's comments 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
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2ec903799009145bce17ad4350e2296082b16e07 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,15 @@ WebNotificationTray::WebNotificationTray(WmShelf* shelf,
DCHECK(status_area_window_);
DCHECK(system_tray_);
- gfx::ImageSkia bell_image;
- if (MaterialDesignController::IsShelfMaterial()) {
- bell_image = CreateVectorIcon(gfx::VectorIconId::SHELF_NOTIFICATIONS,
- kShelfIconColor);
- } else {
- bell_image =
- CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize,
- kWebNotificationColorNoUnread);
- }
- bell_icon_.reset(new WebNotificationImage(bell_image,
- kTrayItemInnerBellIconSize,
+ const bool md_shelf = MaterialDesignController::IsShelfMaterial();
+ gfx::ImageSkia bell_image =
+ md_shelf
+ ? CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor)
+ : CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS,
+ kNoUnreadIconSize, kWebNotificationColorNoUnread);
+ 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());
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698