OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/themes/theme_properties.h" | 5 #include "chrome/browser/themes/theme_properties.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/browser/themes/browser_theme_pack.h" | 13 #include "chrome/browser/themes/browser_theme_pack.h" |
14 #include "chrome/grit/theme_resources.h" | 14 #include "chrome/grit/theme_resources.h" |
15 #include "ui/base/material_design/material_design_controller.h" | 15 #include "ui/base/material_design/material_design_controller.h" |
16 #include "ui/gfx/color_palette.h" | 16 #include "ui/gfx/color_palette.h" |
17 #include "ui/resources/grit/ui_resources.h" | 17 #include "ui/resources/grit/ui_resources.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // ---------------------------------------------------------------------------- | 21 // ---------------------------------------------------------------------------- |
22 // Defaults for properties which are stored in the browser theme pack. If you | 22 // Defaults for properties which are stored in the browser theme pack. If you |
23 // change these defaults, you must increment the version number in | 23 // change these defaults, you must increment the version number in |
24 // browser_theme_pack.cc. | 24 // browser_theme_pack.cc. |
25 | 25 |
26 const SkColor kDefaultColorFrame = SkColorSetRGB(0xCC, 0xCC, 0xCC); | 26 const SkColor kDefaultColorFrame = SkColorSetRGB(0xCC, 0xCC, 0xCC); |
27 #if defined(OS_MACOSX) | |
28 // Used for theme fallback colors. | |
29 const SkColor kDefaultColorFrameInactive = SkColorSetRGB(0xF6, 0xF6, 0xF6); | 27 const SkColor kDefaultColorFrameInactive = SkColorSetRGB(0xF6, 0xF6, 0xF6); |
Peter Kasting
2016/12/01 06:19:04
Shouldn't this be 0xF5?
0xCC = 204
204 + (255 - 2
Bret
2016/12/08 00:16:07
Yes it's supposed to be F5, but I thought a tiny s
Peter Kasting
2016/12/08 00:24:50
Oh, my intent was to just change the OS X color to
Bret
2016/12/08 02:16:59
Ok, changed to F5.
I'll find out what we want to
| |
30 #else | |
31 const SkColor kDefaultColorFrameInactive = SkColorSetRGB(0xDC, 0xDC, 0xDC); | |
32 #endif | |
33 | 28 |
34 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
35 const SkColor kDefaultColorFrameIncognito = | 30 const SkColor kDefaultColorFrameIncognito = |
36 SkColorSetARGB(0xE6, 0x14, 0x16, 0x18); | 31 SkColorSetARGB(0xE6, 0x14, 0x16, 0x18); |
37 const SkColor kDefaultColorFrameIncognitoInactive = | 32 const SkColor kDefaultColorFrameIncognitoInactive = |
38 SkColorSetRGB(0x1E, 0x1E, 0x1E); | 33 SkColorSetRGB(0x1E, 0x1E, 0x1E); |
Peter Kasting
2016/12/01 06:19:04
It worries me that we're leaving the Mac incognito
Bret
2016/12/08 00:16:07
That's a good point. I added some new switches to
| |
39 #else | 34 #else |
40 const SkColor kDefaultColorFrameIncognito = SkColorSetRGB(0x28, 0x2B, 0x2D); | 35 const SkColor kDefaultColorFrameIncognito = SkColorSetRGB(0x28, 0x2B, 0x2D); |
41 const SkColor kDefaultColorFrameIncognitoInactive = | 36 const SkColor kDefaultColorFrameIncognitoInactive = |
42 SkColorSetRGB(0x38, 0x3B, 0x3D); | 37 SkColorSetRGB(0xD4, 0xD5, 0xD5); |
Evan Stade
2016/11/30 23:27:48
seems a little odd that this is ever so slightly n
Bret
2016/11/30 23:39:30
Yes, I agree it's odd. I decided to leave it becau
Peter Kasting
2016/12/01 06:19:04
Let's leave it as #D4D5D5.
| |
43 #endif | 38 #endif |
44 | 39 |
45 const SkColor kDefaultColorToolbar = SkColorSetRGB(0xF2, 0xF2, 0xF2); | 40 const SkColor kDefaultColorToolbar = SkColorSetRGB(0xF2, 0xF2, 0xF2); |
46 const SkColor kDefaultColorToolbarIncognito = SkColorSetRGB(0x50, 0x50, 0x50); | 41 const SkColor kDefaultColorToolbarIncognito = SkColorSetRGB(0x50, 0x50, 0x50); |
47 | 42 |
48 const SkColor kDefaultDetachedBookmarkBarBackground = SK_ColorWHITE; | 43 const SkColor kDefaultDetachedBookmarkBarBackground = SK_ColorWHITE; |
49 const SkColor kDefaultDetachedBookmarkBarBackgroundIncognito = | 44 const SkColor kDefaultDetachedBookmarkBarBackgroundIncognito = |
50 SkColorSetRGB(0x32, 0x32, 0x32); | 45 SkColorSetRGB(0x32, 0x32, 0x32); |
51 | 46 |
52 // "Toolbar" text is used for active tabs and the bookmarks bar. | 47 // "Toolbar" text is used for active tabs and the bookmarks bar. |
(...skipping 23 matching lines...) Expand all Loading... | |
76 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); | 71 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); |
77 const SkColor kDefaultColorNTPSection = SkColorSetRGB(0xE5, 0xE5, 0xE5); | 72 const SkColor kDefaultColorNTPSection = SkColorSetRGB(0xE5, 0xE5, 0xE5); |
78 constexpr SkColor kDefaultColorNTPSectionText = SK_ColorBLACK; | 73 constexpr SkColor kDefaultColorNTPSectionText = SK_ColorBLACK; |
79 const SkColor kDefaultColorNTPSectionLink = SkColorSetRGB(0x06, 0x37, 0x74); | 74 const SkColor kDefaultColorNTPSectionLink = SkColorSetRGB(0x06, 0x37, 0x74); |
80 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; | 75 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; |
81 | 76 |
82 // Default tints. | 77 // Default tints. |
83 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1}; | 78 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1}; |
84 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85}; | 79 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85}; |
85 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1}; | 80 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1}; |
86 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.75}; | 81 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.9}; |
87 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35}; | 82 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35}; |
88 constexpr color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.3, 0.6}; | 83 constexpr color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.2, 0.87}; |
89 constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, 0.75}; | 84 constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, 0.75}; |
90 | 85 |
91 // ---------------------------------------------------------------------------- | 86 // ---------------------------------------------------------------------------- |
92 // Defaults for properties which are not stored in the browser theme pack. | 87 // Defaults for properties which are not stored in the browser theme pack. |
93 | 88 |
94 constexpr SkColor kDefaultColorControlBackground = SK_ColorWHITE; | 89 constexpr SkColor kDefaultColorControlBackground = SK_ColorWHITE; |
95 const SkColor kDefaultDetachedBookmarkBarSeparator = | 90 const SkColor kDefaultDetachedBookmarkBarSeparator = |
96 SkColorSetRGB(0xB6, 0xB4, 0xB6); | 91 SkColorSetRGB(0xB6, 0xB4, 0xB6); |
97 const SkColor kDefaultDetachedBookmarkBarSeparatorIncognito = | 92 const SkColor kDefaultDetachedBookmarkBarSeparatorIncognito = |
98 SkColorSetRGB(0x28, 0x28, 0x28); | 93 SkColorSetRGB(0x28, 0x28, 0x28); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 case COLOR_FRAME_INCOGNITO: | 313 case COLOR_FRAME_INCOGNITO: |
319 case COLOR_FRAME_INCOGNITO_INACTIVE: | 314 case COLOR_FRAME_INCOGNITO_INACTIVE: |
320 NOTREACHED() << "These values should be queried via their respective " | 315 NOTREACHED() << "These values should be queried via their respective " |
321 "non-incognito equivalents and an appropriate |otr| " | 316 "non-incognito equivalents and an appropriate |otr| " |
322 "value."; | 317 "value."; |
323 return gfx::kPlaceholderColor; | 318 return gfx::kPlaceholderColor; |
324 } | 319 } |
325 | 320 |
326 return gfx::kPlaceholderColor; | 321 return gfx::kPlaceholderColor; |
327 } | 322 } |
OLD | NEW |