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
3 // found in the LICENSE file.
5 #include "ui/message_center/message_center_style.h"
9 namespace message_center
{
11 // Exported values /////////////////////////////////////////////////////////////
13 // Square image sizes in pixels.
14 const int kNotificationButtonIconSize
= 16;
15 const int kNotificationIconSize
= 80;
16 // Same as kNotificationWidth.
17 const int kNotificationPreferredImageSize
= 360;
18 const float kNotificationPreferredImageRatio
= 1.5;
19 const int kSettingsIconSize
= 16;
22 const size_t kMaxVisibleMessageCenterNotifications
= 100;
23 const size_t kMaxVisiblePopupNotifications
= 3;
26 const SkColor kMessageCenterBorderColor
= SkColorSetRGB(0xC7, 0xCA, 0xCE);
27 const SkColor kMessageCenterShadowColor
= SkColorSetARGB(0.5 * 255, 0, 0, 0);
29 // Within a notification ///////////////////////////////////////////////////////
32 const int kControlButtonSize
= 29;
33 const int kNotificationWidth
= 360;
34 const int kIconToTextPadding
= 16;
35 const int kTextTopPadding
= 12;
36 const int kIconBottomPadding
= 16;
39 const int kTitleFontSize
= 14;
40 const int kTitleLineHeight
= 20;
41 const int kMessageFontSize
= 12;
42 const int kMessageLineHeight
= 18;
45 const SkColor kNotificationBackgroundColor
= SkColorSetRGB(255, 255, 255);
46 const SkColor kIconBackgroundColor
= SkColorSetRGB(0xf5, 0xf5, 0xf5);
47 const SkColor kRegularTextColor
= SkColorSetRGB(0x33, 0x33, 0x33);
48 const SkColor kDimTextColor
= SkColorSetRGB(0x7f, 0x7f, 0x7f);
49 const SkColor kFocusBorderColor
= SkColorSetRGB(64, 128, 250);
53 gfx::Size
GetImageSizeForWidth(int width
, const gfx::Size
& image_size
) {
54 const int kNotificationMaximumImageHeight
=
55 kNotificationWidth
* kNotificationPreferredImageRatio
;
57 gfx::Size size
= image_size
;
58 if (width
> 0 && !size
.IsEmpty()) {
59 double proportion
= size
.height() / static_cast<double>(size
.width());
60 size
.SetSize(width
, std::max(0.5 + width
* proportion
, 1.0));
61 if (size
.height() > kNotificationMaximumImageHeight
) {
62 int height
= kNotificationMaximumImageHeight
;
63 size
.SetSize(std::max(0.5 + height
/ proportion
, 1.0), height
);
69 const size_t kNotificationMaximumItems
= 5;
72 const int kAutocloseDefaultDelaySeconds
= 8;
73 const int kAutocloseHighPriorityDelaySeconds
= 25;
75 // Around notifications ////////////////////////////////////////////////////////
78 const int kMarginBetweenItems
= 10;
81 const SkColor kBackgroundLightColor
= SkColorSetRGB(0xf1, 0xf1, 0xf1);
82 const SkColor kBackgroundDarkColor
= SkColorSetRGB(0xe7, 0xe7, 0xe7);
83 const SkColor kShadowColor
= SkColorSetARGB(0.3 * 255, 0, 0, 0);
84 const SkColor kMessageCenterBackgroundColor
= SkColorSetRGB(0xee, 0xee, 0xee);
85 const SkColor kFooterDelimiterColor
= SkColorSetRGB(0xcc, 0xcc, 0xcc);
86 const SkColor kFooterTextColor
= SkColorSetRGB(0x7b, 0x7b, 0x7b);
88 } // namespace message_center