OLD | NEW |
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/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void SetUnreadCount(int unread_count) { | 153 void SetUnreadCount(int unread_count) { |
154 // base::FormatNumber doesn't convert to arabic numeric characters. | 154 // base::FormatNumber doesn't convert to arabic numeric characters. |
155 // TODO(mukai): use ICU to support conversion for such locales. | 155 // TODO(mukai): use ICU to support conversion for such locales. |
156 unread_count_ = unread_count; | 156 unread_count_ = unread_count; |
157 UpdateIconVisibility(); | 157 UpdateIconVisibility(); |
158 } | 158 } |
159 | 159 |
160 protected: | 160 protected: |
161 // Overridden from views::ImageButton: | 161 // Overridden from views::ImageButton: |
162 gfx::Size GetPreferredSize() const override { | 162 gfx::Size GetPreferredSize() const override { |
163 return gfx::Size(kShelfItemHeight, kShelfItemHeight); | 163 const int size = GetTrayConstant(TRAY_ITEM_HEIGHT_LEGACY); |
| 164 return gfx::Size(size, size); |
164 } | 165 } |
165 | 166 |
166 int GetHeightForWidth(int width) const override { | 167 int GetHeightForWidth(int width) const override { |
167 return GetPreferredSize().height(); | 168 return GetPreferredSize().height(); |
168 } | 169 } |
169 | 170 |
170 private: | 171 private: |
171 void UpdateIconVisibility() { | 172 void UpdateIconVisibility() { |
172 if (unread_count_ == 0) { | 173 if (unread_count_ == 0) { |
173 if (!Contains(&no_unread_icon_)) { | 174 if (!Contains(&no_unread_icon_)) { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 530 |
530 message_center::MessageCenterBubble* | 531 message_center::MessageCenterBubble* |
531 WebNotificationTray::GetMessageCenterBubbleForTest() { | 532 WebNotificationTray::GetMessageCenterBubbleForTest() { |
532 if (!message_center_bubble()) | 533 if (!message_center_bubble()) |
533 return NULL; | 534 return NULL; |
534 return static_cast<message_center::MessageCenterBubble*>( | 535 return static_cast<message_center::MessageCenterBubble*>( |
535 message_center_bubble()->bubble()); | 536 message_center_bubble()->bubble()); |
536 } | 537 } |
537 | 538 |
538 } // namespace ash | 539 } // namespace ash |
OLD | NEW |