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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Character limits: Displayed text will be subject to the line limits above, | 53 // Character limits: Displayed text will be subject to the line limits above, |
54 // but we also remove trailing characters from text to reduce processing cost. | 54 // but we also remove trailing characters from text to reduce processing cost. |
55 // Character limit = pixels per line * line limit / min. pixels per character. | 55 // Character limit = pixels per line * line limit / min. pixels per character. |
56 const size_t kTitleCharacterLimit = | 56 const size_t kTitleCharacterLimit = |
57 message_center::kNotificationWidth * kTitleLineLimit / 4; | 57 message_center::kNotificationWidth * kTitleLineLimit / 4; |
58 const size_t kMessageCharacterLimit = | 58 const size_t kMessageCharacterLimit = |
59 message_center::kNotificationWidth * kMessageExpandedLineLimit / 3; | 59 message_center::kNotificationWidth * kMessageExpandedLineLimit / 3; |
60 | 60 |
61 // Notification colors. The text background colors below are used only to keep | 61 // Notification colors. The text background colors below are used only to keep |
62 // view::Label from modifying the text color and will not actually be drawn. | 62 // view::Label from modifying the text color and will not actually be drawn. |
63 // See view::Label's SetEnabledColor() and SetBackgroundColor() for details. | 63 // See view::Label's RecalculateColors() for details. |
64 const SkColor kRegularTextBackgroundColor = SK_ColorWHITE; | 64 const SkColor kRegularTextBackgroundColor = SK_ColorWHITE; |
65 const SkColor kDimTextColor = SkColorSetRGB(102, 102, 102); | 65 const SkColor kDimTextColor = SkColorSetRGB(102, 102, 102); |
66 const SkColor kDimTextBackgroundColor = SK_ColorBLACK; | 66 const SkColor kDimTextBackgroundColor = SK_ColorWHITE; |
67 const SkColor kButtonSeparatorColor = SkColorSetRGB(234, 234, 234); | 67 const SkColor kButtonSeparatorColor = SkColorSetRGB(234, 234, 234); |
68 const SkColor kHoveredButtonBackgroundColor = SkColorSetRGB(243, 243, 243); | 68 const SkColor kHoveredButtonBackgroundColor = SkColorSetRGB(243, 243, 243); |
69 | 69 |
70 // static | 70 // static |
71 views::Background* MakeBackground( | 71 views::Background* MakeBackground( |
72 SkColor color = message_center::kNotificationBackgroundColor) { | 72 SkColor color = message_center::kNotificationBackgroundColor) { |
73 return views::Background::CreateSolidBackground(color); | 73 return views::Background::CreateSolidBackground(color); |
74 } | 74 } |
75 | 75 |
76 // static | 76 // static |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 return message_view_ ? | 625 return message_view_ ? |
626 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; | 626 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; |
627 } | 627 } |
628 | 628 |
629 int NotificationView::GetMessageHeight(int width, int limit) { | 629 int NotificationView::GetMessageHeight(int width, int limit) { |
630 return message_view_ ? | 630 return message_view_ ? |
631 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 631 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
632 } | 632 } |
633 | 633 |
634 } // namespace message_center | 634 } // namespace message_center |
OLD | NEW |