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

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

Issue 2324913002: Updates to shelf icons for Ash material design (Closed)
Patch Set: remove size parameter 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 48ce6af02fc4bb9e2a722110b7d577b25d51fefb..5ab4fc0d0562957a36679d02720355849568a9cd 100644
--- a/ash/common/system/web_notification/web_notification_tray.cc
+++ b/ash/common/system/web_notification/web_notification_tray.cc
@@ -20,6 +20,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"
@@ -50,7 +51,7 @@ namespace message_center {
MessageCenterTrayDelegate* CreateMessageCenterTray() {
// On Windows+Ash the Tray will not be hosted in ash::Shell.
NOTREACHED();
- return NULL;
+ return nullptr;
}
} // namespace message_center
@@ -66,8 +67,6 @@ constexpr int kEnableQuietModeDay = 2;
constexpr int kMaximumSmallIconCount = 3;
-constexpr gfx::Size kTrayItemInnerIconSize(16, 16);
-constexpr gfx::Size kTrayItemInnerBellIconSize(18, 18);
constexpr gfx::Size kTrayItemOuterSize(26, 26);
constexpr gfx::Insets kTrayItemInsets(3, 3);
@@ -241,13 +240,11 @@ class WebNotificationItem : public views::View, public gfx::AnimationDelegate {
class WebNotificationImage : public WebNotificationItem {
public:
WebNotificationImage(const gfx::ImageSkia& image,
- gfx::Size size,
gfx::AnimationContainer* container,
WebNotificationTray* tray)
: WebNotificationItem(container, tray) {
view_ = new views::ImageView();
view_->SetImage(image);
- view_->SetImageSize(size);
AddChildView(view_);
}
@@ -305,17 +302,12 @@ 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);
- }
+ gfx::ImageSkia bell_image =
+ MaterialDesignController::IsShelfMaterial()
+ ? CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor)
+ : CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS,
+ kNoUnreadIconSize, kWebNotificationColorNoUnread);
bell_icon_.reset(new WebNotificationImage(bell_image,
- kTrayItemInnerBellIconSize,
animation_container_.get(), this));
tray_container()->AddChildView(bell_icon_.get());
@@ -600,9 +592,8 @@ void WebNotificationTray::UpdateTrayContent() {
if (visible_small_icons_.count(notification->id()) != 0)
continue;
- auto* item =
- new WebNotificationImage(image.AsImageSkia(), kTrayItemInnerIconSize,
- animation_container_.get(), this);
+ auto* item = new WebNotificationImage(image.AsImageSkia(),
+ animation_container_.get(), this);
visible_small_icons_.insert(std::make_pair(notification->id(), item));
tray_container()->AddChildViewAt(item, 0);
@@ -668,7 +659,7 @@ bool WebNotificationTray::IsPopupVisible() const {
message_center::MessageCenterBubble*
WebNotificationTray::GetMessageCenterBubbleForTest() {
if (!message_center_bubble())
- return NULL;
+ return nullptr;
return static_cast<message_center::MessageCenterBubble*>(
message_center_bubble()->bubble());
}
« 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