| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 private: | 262 private: |
| 263 views::ImageView* icon_; | 263 views::ImageView* icon_; |
| 264 views::Label* title_; | 264 views::Label* title_; |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 NotificationButton::NotificationButton(views::ButtonListener* listener) | 267 NotificationButton::NotificationButton(views::ButtonListener* listener) |
| 268 : views::CustomButton(listener), | 268 : views::CustomButton(listener), |
| 269 icon_(NULL), | 269 icon_(NULL), |
| 270 title_(NULL) { | 270 title_(NULL) { |
| 271 set_focusable(true); | 271 set_focusable(true); |
| 272 set_request_focus_on_press(false); |
| 272 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 273 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
| 273 kButtonHorizontalPadding, | 274 kButtonHorizontalPadding, |
| 274 kButtonVecticalPadding, | 275 kButtonVecticalPadding, |
| 275 kButtonIconToTitlePadding)); | 276 kButtonIconToTitlePadding)); |
| 276 } | 277 } |
| 277 | 278 |
| 278 NotificationButton::~NotificationButton() { | 279 NotificationButton::~NotificationButton() { |
| 279 } | 280 } |
| 280 | 281 |
| 281 void NotificationButton::SetIcon(const gfx::ImageSkia& image) { | 282 void NotificationButton::SetIcon(const gfx::ImageSkia& image) { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 return message_view_ ? | 605 return message_view_ ? |
| 605 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; | 606 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; |
| 606 } | 607 } |
| 607 | 608 |
| 608 int NotificationView::GetMessageHeight(int width, int limit) { | 609 int NotificationView::GetMessageHeight(int width, int limit) { |
| 609 return message_view_ ? | 610 return message_view_ ? |
| 610 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 611 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 611 } | 612 } |
| 612 | 613 |
| 613 } // namespace message_center | 614 } // namespace message_center |
| OLD | NEW |