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/system/chromeos/label_tray_view.h" | 5 #include "ash/system/chromeos/label_tray_view.h" |
6 | 6 |
7 #include "ash/system/tray/hover_highlight_view.h" | 7 #include "ash/system/tray/hover_highlight_view.h" |
8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
9 #include "ash/system/tray/view_click_listener.h" | 9 #include "ash/system/tray/view_click_listener.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 views::View* LabelTrayView::CreateChildView( | 43 views::View* LabelTrayView::CreateChildView( |
44 const base::string16& message) const { | 44 const base::string16& message) const { |
45 HoverHighlightView* child = new HoverHighlightView(click_listener_); | 45 HoverHighlightView* child = new HoverHighlightView(click_listener_); |
46 if (icon_resource_id_) { | 46 if (icon_resource_id_) { |
47 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 47 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
48 const gfx::ImageSkia* icon = rb.GetImageSkiaNamed(icon_resource_id_); | 48 const gfx::ImageSkia* icon = rb.GetImageSkiaNamed(icon_resource_id_); |
49 child->AddIconAndLabel(*icon, message, gfx::Font::NORMAL); | 49 child->AddIconAndLabel(*icon, message, gfx::Font::NORMAL); |
50 child->set_border( | 50 child->set_border( |
51 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, | 51 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, |
52 0, kTrayPopupPaddingHorizontal)); | 52 0, kTrayPopupPaddingHorizontal)); |
| 53 child->text_label()->SetMultiLine(true); |
53 child->text_label()->SizeToFit(kTrayNotificationContentsWidth); | 54 child->text_label()->SizeToFit(kTrayNotificationContentsWidth); |
54 } else { | 55 } else { |
55 child->AddLabel(message, gfx::Font::NORMAL); | 56 child->AddLabel(message, gfx::Font::NORMAL); |
| 57 child->text_label()->SetMultiLine(true); |
56 child->text_label()->SizeToFit(kTrayNotificationContentsWidth + | 58 child->text_label()->SizeToFit(kTrayNotificationContentsWidth + |
57 kNotificationIconWidth); | 59 kNotificationIconWidth); |
58 } | 60 } |
59 child->text_label()->SetMultiLine(true); | |
60 child->text_label()->SetAllowCharacterBreak(true); | 61 child->text_label()->SetAllowCharacterBreak(true); |
61 child->SetExpandable(true); | 62 child->SetExpandable(true); |
62 child->SetVisible(true); | 63 child->SetVisible(true); |
63 return child; | 64 return child; |
64 } | 65 } |
65 | 66 |
66 } // namespace internal | 67 } // namespace internal |
67 } // namespace ash | 68 } // namespace ash |
OLD | NEW |