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 "ui/message_center/message_center_bubble.h" | 5 #include "ui/message_center/message_center_bubble.h" |
6 | 6 |
7 #include "grit/ui_strings.h" | 7 #include "grit/ui_strings.h" |
8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 scroll_content_->AddChildView(view); | 202 scroll_content_->AddChildView(view); |
203 if (++num_children >= | 203 if (++num_children >= |
204 NotificationList::kMaxVisibleMessageCenterNotifications) { | 204 NotificationList::kMaxVisibleMessageCenterNotifications) { |
205 break; | 205 break; |
206 } | 206 } |
207 } | 207 } |
208 if (num_children == 0) { | 208 if (num_children == 0) { |
209 views::Label* label = new views::Label(l10n_util::GetStringUTF16( | 209 views::Label* label = new views::Label(l10n_util::GetStringUTF16( |
210 IDS_MESSAGE_CENTER_NO_MESSAGES)); | 210 IDS_MESSAGE_CENTER_NO_MESSAGES)); |
211 label->SetFont(label->font().DeriveFont(1)); | 211 label->SetFont(label->font().DeriveFont(1)); |
212 label->SetHorizontalAlignment(views::Label::ALIGN_CENTER); | |
213 label->SetEnabledColor(SK_ColorGRAY); | 212 label->SetEnabledColor(SK_ColorGRAY); |
214 scroll_content_->AddChildView(label); | 213 scroll_content_->AddChildView(label); |
215 button_view_->SetCloseAllVisible(false); | 214 button_view_->SetCloseAllVisible(false); |
216 } else { | 215 } else { |
217 button_view_->SetCloseAllVisible(true); | 216 button_view_->SetCloseAllVisible(true); |
218 } | 217 } |
219 SizeScrollContent(); | 218 SizeScrollContent(); |
220 Layout(); | 219 Layout(); |
221 if (GetWidget()) | 220 if (GetWidget()) |
222 GetWidget()->GetRootView()->SchedulePaint(); | 221 GetWidget()->GetRootView()->SchedulePaint(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 294 } |
296 | 295 |
297 void MessageCenterBubble::OnMouseExitedView() { | 296 void MessageCenterBubble::OnMouseExitedView() { |
298 } | 297 } |
299 | 298 |
300 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 299 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
301 return contents_view_->NumMessageViews(); | 300 return contents_view_->NumMessageViews(); |
302 } | 301 } |
303 | 302 |
304 } // namespace message_center | 303 } // namespace message_center |
OLD | NEW |