Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/themes/theme_properties.cc

Issue 2712583002: Revert incognito and theme inactive color changes. (Closed)
Patch Set: update Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 const SkColor kDefaultColorFrameInactive = SkColorSetRGB(0xF5, 0xF5, 0xF5);
27 28
28 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
29 const SkColor kDefaultColorFrameIncognito = 30 const SkColor kDefaultColorFrameIncognito =
30 SkColorSetARGB(0xE6, 0x14, 0x16, 0x18); 31 SkColorSetARGB(0xE6, 0x14, 0x16, 0x18);
31 const SkColor kDefaultColorFrameIncognitoInactiveMac = 32 const SkColor kDefaultColorFrameIncognitoInactive =
32 SkColorSetRGB(0x1E, 0x1E, 0x1E); 33 SkColorSetRGB(0x1E, 0x1E, 0x1E);
33 #else 34 #else
34 const SkColor kDefaultColorFrameIncognito = SkColorSetRGB(0x28, 0x2B, 0x2D); 35 const SkColor kDefaultColorFrameIncognito = SkColorSetRGB(0x28, 0x2B, 0x2D);
36 const SkColor kDefaultColorFrameIncognitoInactive =
37 SkColorSetRGB(0x38, 0x3B, 0x3D);
35 #endif 38 #endif
36 39
37 const SkColor kDefaultColorToolbar = SkColorSetRGB(0xF2, 0xF2, 0xF2); 40 const SkColor kDefaultColorToolbar = SkColorSetRGB(0xF2, 0xF2, 0xF2);
38 const SkColor kDefaultColorToolbarIncognito = SkColorSetRGB(0x50, 0x50, 0x50); 41 const SkColor kDefaultColorToolbarIncognito = SkColorSetRGB(0x50, 0x50, 0x50);
39 42
40 const SkColor kDefaultDetachedBookmarkBarBackground = SK_ColorWHITE; 43 const SkColor kDefaultDetachedBookmarkBarBackground = SK_ColorWHITE;
41 const SkColor kDefaultDetachedBookmarkBarBackgroundIncognito = 44 const SkColor kDefaultDetachedBookmarkBarBackgroundIncognito =
42 SkColorSetRGB(0x32, 0x32, 0x32); 45 SkColorSetRGB(0x32, 0x32, 0x32);
43 46
44 // "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
68 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); 71 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96);
69 const SkColor kDefaultColorNTPSection = SkColorSetRGB(0xE5, 0xE5, 0xE5); 72 const SkColor kDefaultColorNTPSection = SkColorSetRGB(0xE5, 0xE5, 0xE5);
70 constexpr SkColor kDefaultColorNTPSectionText = SK_ColorBLACK; 73 constexpr SkColor kDefaultColorNTPSectionText = SK_ColorBLACK;
71 const SkColor kDefaultColorNTPSectionLink = SkColorSetRGB(0x06, 0x37, 0x74); 74 const SkColor kDefaultColorNTPSectionLink = SkColorSetRGB(0x06, 0x37, 0x74);
72 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; 75 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT;
73 76
74 // Default tints. 77 // Default tints.
75 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1}; 78 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1};
76 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85}; 79 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85};
77 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1}; 80 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1};
78 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.9}; 81 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.75};
79 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35}; 82 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35};
80 constexpr color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.2, 0.87}; 83 constexpr color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.3, 0.6};
81 constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, 0.75}; 84 constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, 0.75};
82 85
83 // ---------------------------------------------------------------------------- 86 // ----------------------------------------------------------------------------
84 // 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.
85 88
86 constexpr SkColor kDefaultColorControlBackground = SK_ColorWHITE; 89 constexpr SkColor kDefaultColorControlBackground = SK_ColorWHITE;
87 const SkColor kDefaultDetachedBookmarkBarSeparator = 90 const SkColor kDefaultDetachedBookmarkBarSeparator =
88 SkColorSetRGB(0xB6, 0xB4, 0xB6); 91 SkColorSetRGB(0xB6, 0xB4, 0xB6);
89 const SkColor kDefaultDetachedBookmarkBarSeparatorIncognito = 92 const SkColor kDefaultDetachedBookmarkBarSeparatorIncognito =
90 SkColorSetRGB(0x28, 0x28, 0x28); 93 SkColorSetRGB(0x28, 0x28, 0x28);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 224 }
222 } 225 }
223 226
224 // static 227 // static
225 SkColor ThemeProperties::GetDefaultColor(int id, bool otr) { 228 SkColor ThemeProperties::GetDefaultColor(int id, bool otr) {
226 switch (id) { 229 switch (id) {
227 // Properties stored in theme pack. 230 // Properties stored in theme pack.
228 case COLOR_FRAME: 231 case COLOR_FRAME:
229 return otr ? kDefaultColorFrameIncognito : kDefaultColorFrame; 232 return otr ? kDefaultColorFrameIncognito : kDefaultColorFrame;
230 case COLOR_FRAME_INACTIVE: 233 case COLOR_FRAME_INACTIVE:
231 #if defined(OS_MACOSX) 234 return otr ? kDefaultColorFrameIncognitoInactive
232 if (otr) 235 : kDefaultColorFrameInactive;
233 return kDefaultColorFrameIncognitoInactiveMac;
234 #endif
235 return color_utils::HSLShift(
236 GetDefaultColor(ThemeProperties::COLOR_FRAME, otr),
237 GetDefaultTint(ThemeProperties::TINT_FRAME_INACTIVE, false));
238 case COLOR_TOOLBAR: 236 case COLOR_TOOLBAR:
239 return otr ? kDefaultColorToolbarIncognito : kDefaultColorToolbar; 237 return otr ? kDefaultColorToolbarIncognito : kDefaultColorToolbar;
240 case COLOR_TAB_TEXT: 238 case COLOR_TAB_TEXT:
241 case COLOR_BOOKMARK_TEXT: 239 case COLOR_BOOKMARK_TEXT:
242 return otr ? kDefaultColorToolbarTextIncognito : kDefaultColorToolbarText; 240 return otr ? kDefaultColorToolbarTextIncognito : kDefaultColorToolbarText;
243 case COLOR_BACKGROUND_TAB_TEXT: 241 case COLOR_BACKGROUND_TAB_TEXT:
244 return otr ? kDefaultColorBackgroundTabTextIncognito 242 return otr ? kDefaultColorBackgroundTabTextIncognito
245 : kDefaultColorBackgroundTabText; 243 : kDefaultColorBackgroundTabText;
246 case COLOR_NTP_BACKGROUND: 244 case COLOR_NTP_BACKGROUND:
247 return kDefaultColorNTPBackground; 245 return kDefaultColorNTPBackground;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 case COLOR_FRAME_INCOGNITO: 313 case COLOR_FRAME_INCOGNITO:
316 case COLOR_FRAME_INCOGNITO_INACTIVE: 314 case COLOR_FRAME_INCOGNITO_INACTIVE:
317 NOTREACHED() << "These values should be queried via their respective " 315 NOTREACHED() << "These values should be queried via their respective "
318 "non-incognito equivalents and an appropriate |otr| " 316 "non-incognito equivalents and an appropriate |otr| "
319 "value."; 317 "value.";
320 return gfx::kPlaceholderColor; 318 return gfx::kPlaceholderColor;
321 } 319 }
322 320
323 return gfx::kPlaceholderColor; 321 return gfx::kPlaceholderColor;
324 } 322 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698