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/notification_view.h" | 5 #include "ui/message_center/notification_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "ui/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 icon->SetVerticalAlignment(views::ImageView::LEADING); | 139 icon->SetVerticalAlignment(views::ImageView::LEADING); |
140 icon->set_border(MakePadding(kIconTopPadding, kIconLeftPadding, | 140 icon->set_border(MakePadding(kIconTopPadding, kIconLeftPadding, |
141 kIconBottomPadding, kIconToTextPadding)); | 141 kIconBottomPadding, kIconToTextPadding)); |
142 layout->AddView(icon, 1, 2 + notification_.items.size()); | 142 layout->AddView(icon, 1, 2 + notification_.items.size()); |
143 | 143 |
144 // First row: Title. This vertically spans the close button padding row and | 144 // First row: Title. This vertically spans the close button padding row and |
145 // the close button row. | 145 // the close button row. |
146 // TODO(dharcourt): Skip the title Label when there's no title text. | 146 // TODO(dharcourt): Skip the title Label when there's no title text. |
147 views::Label* title = new views::Label(notification_.title); | 147 views::Label* title = new views::Label(notification_.title); |
148 title->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 148 title->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 149 title->SetElideBehavior(views::Label::ELIDE_AT_END); |
149 title->SetFont(title->font().DeriveFont(4)); | 150 title->SetFont(title->font().DeriveFont(4)); |
150 title->SetEnabledColor(kTitleColor); | 151 title->SetEnabledColor(kTitleColor); |
151 title->SetBackgroundColor(kTitleBackgroundColor); | 152 title->SetBackgroundColor(kTitleBackgroundColor); |
152 title->set_border(MakePadding(kTextTopPadding, 0, 3, kTextToClosePadding)); | 153 title->set_border(MakePadding(kTextTopPadding, 0, 3, kTextToClosePadding)); |
153 layout->AddView(title, 1, 2); | 154 layout->AddView(title, 1, 2); |
154 | 155 |
155 // First row: Close button padding. | 156 // First row: Close button padding. |
156 views::View* padding = new views::ImageView(); | 157 views::View* padding = new views::ImageView(); |
157 padding->set_border(MakePadding(kCloseTopPadding, 1, 0, 0)); | 158 padding->set_border(MakePadding(kCloseTopPadding, 1, 0, 0)); |
158 layout->AddView(padding); | 159 layout->AddView(padding); |
(...skipping 13 matching lines...) Expand all Loading... |
172 layout->StartRow(0, 0); | 173 layout->StartRow(0, 0); |
173 layout->SkipColumns(1); | 174 layout->SkipColumns(1); |
174 ItemView* item = new ItemView(notification_.items[i]); | 175 ItemView* item = new ItemView(notification_.items[i]); |
175 item->set_border(MakePadding(0, 0, bottom_padding, kTextToClosePadding)); | 176 item->set_border(MakePadding(0, 0, bottom_padding, kTextToClosePadding)); |
176 layout->AddView(item); | 177 layout->AddView(item); |
177 layout->SkipColumns(1); | 178 layout->SkipColumns(1); |
178 } | 179 } |
179 } | 180 } |
180 | 181 |
181 } // namespace message_center | 182 } // namespace message_center |
OLD | NEW |