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/views/notification_view.h" | 5 #include "ui/message_center/views/notification_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/base/accessibility/accessible_view_state.h" | 10 #include "ui/base/accessibility/accessible_view_state.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 private: | 263 private: |
264 views::ImageView* icon_; | 264 views::ImageView* icon_; |
265 views::Label* title_; | 265 views::Label* title_; |
266 }; | 266 }; |
267 | 267 |
268 NotificationButton::NotificationButton(views::ButtonListener* listener) | 268 NotificationButton::NotificationButton(views::ButtonListener* listener) |
269 : views::CustomButton(listener), | 269 : views::CustomButton(listener), |
270 icon_(NULL), | 270 icon_(NULL), |
271 title_(NULL) { | 271 title_(NULL) { |
272 set_focusable(true); | 272 set_focusable(true); |
| 273 set_request_focus_on_press(false); |
273 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 274 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
274 kButtonHorizontalPadding, | 275 kButtonHorizontalPadding, |
275 kButtonVecticalPadding, | 276 kButtonVecticalPadding, |
276 kButtonIconToTitlePadding)); | 277 kButtonIconToTitlePadding)); |
277 } | 278 } |
278 | 279 |
279 NotificationButton::~NotificationButton() { | 280 NotificationButton::~NotificationButton() { |
280 } | 281 } |
281 | 282 |
282 void NotificationButton::SetIcon(const gfx::ImageSkia& image) { | 283 void NotificationButton::SetIcon(const gfx::ImageSkia& image) { |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 return message_view_ ? | 616 return message_view_ ? |
616 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; | 617 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; |
617 } | 618 } |
618 | 619 |
619 int NotificationView::GetMessageHeight(int width, int limit) { | 620 int NotificationView::GetMessageHeight(int width, int limit) { |
620 return message_view_ ? | 621 return message_view_ ? |
621 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 622 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
622 } | 623 } |
623 | 624 |
624 } // namespace message_center | 625 } // namespace message_center |
OLD | NEW |