Home | History | Annotate | Download | only in message_center
      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.
      4 
      5 #include "ui/message_center/message_center_style.h"
      6 
      7 #include <algorithm>
      8 
      9 namespace message_center {
     10 
     11 // Exported values /////////////////////////////////////////////////////////////
     12 
     13 // Colors.
     14 const SkColor kMessageCenterBorderColor = SkColorSetRGB(0xC7, 0xCA, 0xCE);
     15 const SkColor kMessageCenterShadowColor = SkColorSetARGB(0.5 * 255, 0, 0, 0);
     16 
     17 // Within a notification ///////////////////////////////////////////////////////
     18 
     19 // Colors.
     20 const SkColor kNotificationBackgroundColor = SkColorSetRGB(255, 255, 255);
     21 const SkColor kIconBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5);
     22 const SkColor kImageBackgroundColor = SkColorSetRGB(0x22, 0x22, 0x22);
     23 const SkColor kRegularTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
     24 const SkColor kDimTextColor = SkColorSetRGB(0x7f, 0x7f, 0x7f);
     25 const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
     26 
     27 // Limits.
     28 
     29 gfx::Size GetImageSizeForWidth(int width, const gfx::Size& image_size) {
     30   gfx::Size size = image_size;
     31   if (width > 0 && !size.IsEmpty()) {
     32     double proportion = size.height() / static_cast<double>(size.width());
     33     size.SetSize(width, std::max(0.5 + width * proportion, 1.0));
     34     if (size.height() > kNotificationPreferredImageHeight) {
     35       int height = kNotificationPreferredImageHeight;
     36       size.SetSize(std::max(0.5 + height / proportion, 1.0), height);
     37     }
     38   }
     39   return size;
     40 }
     41 
     42 const size_t kNotificationMaximumItems = 5;
     43 
     44 // Timing.
     45 const int kAutocloseDefaultDelaySeconds = 8;
     46 const int kAutocloseHighPriorityDelaySeconds = 25;
     47 
     48 // Colors.
     49 const SkColor kBackgroundLightColor = SkColorSetRGB(0xf1, 0xf1, 0xf1);
     50 const SkColor kBackgroundDarkColor = SkColorSetRGB(0xe7, 0xe7, 0xe7);
     51 const SkColor kShadowColor = SkColorSetARGB(0.3 * 255, 0, 0, 0);
     52 const SkColor kMessageCenterBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee);
     53 const SkColor kFooterDelimiterColor = SkColorSetRGB(0xcc, 0xcc, 0xcc);
     54 const SkColor kFooterTextColor = SkColorSetRGB(0x7b, 0x7b, 0x7b);
     55 
     56 }  // namespace message_center
     57