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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 2099103002: Give Ash material design tray items the correct size and layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for review Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void SetUnreadCount(int unread_count) { 154 void SetUnreadCount(int unread_count) {
155 // base::FormatNumber doesn't convert to arabic numeric characters. 155 // base::FormatNumber doesn't convert to arabic numeric characters.
156 // TODO(mukai): use ICU to support conversion for such locales. 156 // TODO(mukai): use ICU to support conversion for such locales.
157 unread_count_ = unread_count; 157 unread_count_ = unread_count;
158 UpdateIconVisibility(); 158 UpdateIconVisibility();
159 } 159 }
160 160
161 protected: 161 protected:
162 // Overridden from views::ImageButton: 162 // Overridden from views::ImageButton:
163 gfx::Size GetPreferredSize() const override { 163 gfx::Size GetPreferredSize() const override {
164 return gfx::Size(kShelfItemHeight, kShelfItemHeight); 164 const int size = GetTrayConstant(TRAY_ITEM_HEIGHT_LEGACY);
165 return gfx::Size(size, size);
165 } 166 }
166 167
167 int GetHeightForWidth(int width) const override { 168 int GetHeightForWidth(int width) const override {
168 return GetPreferredSize().height(); 169 return GetPreferredSize().height();
169 } 170 }
170 171
171 private: 172 private:
172 void UpdateIconVisibility() { 173 void UpdateIconVisibility() {
173 if (unread_count_ == 0) { 174 if (unread_count_ == 0) {
174 if (!Contains(&no_unread_icon_)) { 175 if (!Contains(&no_unread_icon_)) {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 534
534 message_center::MessageCenterBubble* 535 message_center::MessageCenterBubble*
535 WebNotificationTray::GetMessageCenterBubbleForTest() { 536 WebNotificationTray::GetMessageCenterBubbleForTest() {
536 if (!message_center_bubble()) 537 if (!message_center_bubble())
537 return NULL; 538 return NULL;
538 return static_cast<message_center::MessageCenterBubble*>( 539 return static_cast<message_center::MessageCenterBubble*>(
539 message_center_bubble()->bubble()); 540 message_center_bubble()->bubble());
540 } 541 }
541 542
542 } // namespace ash 543 } // namespace ash
OLDNEW
« ash/system/status_area_widget_delegate.cc ('K') | « ash/system/user/user_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698