Get foreground tab on Android
[chromium-blink-merge.git] / ui / message_center / message_center_style.cc
blob5b400164ccdd305c9bec7f2e281bccbf1e3149a6
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"
7 #include <algorithm>
9 namespace message_center {
11 // Exported values /////////////////////////////////////////////////////////////
13 // Colors.
14 const SkColor kMessageCenterBorderColor = SkColorSetRGB(0xC7, 0xCA, 0xCE);
15 const SkColor kMessageCenterShadowColor = SkColorSetARGB(0.5 * 255, 0, 0, 0);
17 // Within a notification ///////////////////////////////////////////////////////
19 // Colors.
20 const SkColor kNotificationBackgroundColor = SkColorSetRGB(255, 255, 255);
21 const SkColor kIconBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5);
22 const SkColor kRegularTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
23 const SkColor kDimTextColor = SkColorSetRGB(0x7f, 0x7f, 0x7f);
24 const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
26 // Limits.
28 gfx::Size GetImageSizeForWidth(int width, const gfx::Size& image_size) {
29 const int kNotificationMaximumImageHeight =
30 kNotificationWidth * kNotificationPreferredImageRatio;
32 gfx::Size size = image_size;
33 if (width > 0 && !size.IsEmpty()) {
34 double proportion = size.height() / static_cast<double>(size.width());
35 size.SetSize(width, std::max(0.5 + width * proportion, 1.0));
36 if (size.height() > kNotificationMaximumImageHeight) {
37 int height = kNotificationMaximumImageHeight;
38 size.SetSize(std::max(0.5 + height / proportion, 1.0), height);
41 return size;
44 const size_t kNotificationMaximumItems = 5;
46 // Timing.
47 const int kAutocloseDefaultDelaySeconds = 8;
48 const int kAutocloseHighPriorityDelaySeconds = 25;
50 // Colors.
51 const SkColor kBackgroundLightColor = SkColorSetRGB(0xf1, 0xf1, 0xf1);
52 const SkColor kBackgroundDarkColor = SkColorSetRGB(0xe7, 0xe7, 0xe7);
53 const SkColor kShadowColor = SkColorSetARGB(0.3 * 255, 0, 0, 0);
54 const SkColor kMessageCenterBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee);
55 const SkColor kFooterDelimiterColor = SkColorSetRGB(0xcc, 0xcc, 0xcc);
56 const SkColor kFooterTextColor = SkColorSetRGB(0x7b, 0x7b, 0x7b);
58 } // namespace message_center