| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 break; | 203 break; |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 if (num_children == 0) { | 206 if (num_children == 0) { |
| 207 views::Label* label = new views::Label(l10n_util::GetStringUTF16( | 207 views::Label* label = new views::Label(l10n_util::GetStringUTF16( |
| 208 IDS_MESSAGE_CENTER_NO_MESSAGES)); | 208 IDS_MESSAGE_CENTER_NO_MESSAGES)); |
| 209 label->SetFont(label->font().DeriveFont(1)); | 209 label->SetFont(label->font().DeriveFont(1)); |
| 210 label->SetEnabledColor(SK_ColorGRAY); | 210 label->SetEnabledColor(SK_ColorGRAY); |
| 211 scroll_content_->AddChildView(label); | 211 scroll_content_->AddChildView(label); |
| 212 button_view_->SetCloseAllVisible(false); | 212 button_view_->SetCloseAllVisible(false); |
| 213 scroller_->set_focusable(false); |
| 213 } else { | 214 } else { |
| 214 button_view_->SetCloseAllVisible(true); | 215 button_view_->SetCloseAllVisible(true); |
| 216 scroller_->set_focusable(true); |
| 215 } | 217 } |
| 216 SizeScrollContent(); | 218 SizeScrollContent(); |
| 217 Layout(); | 219 Layout(); |
| 218 if (GetWidget()) | 220 if (GetWidget()) |
| 219 GetWidget()->GetRootView()->SchedulePaint(); | 221 GetWidget()->GetRootView()->SchedulePaint(); |
| 220 } | 222 } |
| 221 | 223 |
| 222 size_t NumMessageViews() const { | 224 size_t NumMessageViews() const { |
| 223 return scroll_content_->child_count(); | 225 return scroll_content_->child_count(); |
| 224 } | 226 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 295 } |
| 294 | 296 |
| 295 void MessageCenterBubble::OnMouseExitedView() { | 297 void MessageCenterBubble::OnMouseExitedView() { |
| 296 } | 298 } |
| 297 | 299 |
| 298 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 300 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
| 299 return contents_view_->NumMessageViews(); | 301 return contents_view_->NumMessageViews(); |
| 300 } | 302 } |
| 301 | 303 |
| 302 } // namespace message_center | 304 } // namespace message_center |
| OLD | NEW |