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

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

Issue 2891983003: Fix white flash when opening incognito NTP (Closed)
Patch Set: . Created 3 years, 7 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/resources/ntp4/md_incognito_tab.css ('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"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 color_utils::GetSysSkColor(COLOR_WINDOW); 60 color_utils::GetSysSkColor(COLOR_WINDOW);
61 const SkColor kDefaultColorNTPText = 61 const SkColor kDefaultColorNTPText =
62 color_utils::GetSysSkColor(COLOR_WINDOWTEXT); 62 color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
63 const SkColor kDefaultColorNTPLink = color_utils::GetSysSkColor(COLOR_HOTLIGHT); 63 const SkColor kDefaultColorNTPLink = color_utils::GetSysSkColor(COLOR_HOTLIGHT);
64 #else 64 #else
65 // TODO(beng): source from theme provider. 65 // TODO(beng): source from theme provider.
66 constexpr SkColor kDefaultColorNTPBackground = SK_ColorWHITE; 66 constexpr SkColor kDefaultColorNTPBackground = SK_ColorWHITE;
67 constexpr SkColor kDefaultColorNTPText = SK_ColorBLACK; 67 constexpr SkColor kDefaultColorNTPText = SK_ColorBLACK;
68 const SkColor kDefaultColorNTPLink = SkColorSetRGB(0x06, 0x37, 0x74); 68 const SkColor kDefaultColorNTPLink = SkColorSetRGB(0x06, 0x37, 0x74);
69 #endif // OS_WIN 69 #endif // OS_WIN
70 const SkColor kDefaultColorNTPBackgroundOtr = SkColorSetRGB(0x30, 0x30, 0x30);
Evan Stade 2017/05/19 15:34:54 nit: the term used for the colors in this file is
Marc Treib 2017/05/19 17:13:42 I was being consistent with the "bool otr" below ;
70 71
71 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); 72 const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96);
72 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; 73 constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT;
73 74
74 // Default tints. 75 // Default tints.
75 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1}; 76 constexpr color_utils::HSL kDefaultTintButtons = {-1, -1, -1};
76 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85}; 77 constexpr color_utils::HSL kDefaultTintButtonsIncognito = {-1, -1, 0.85};
77 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1}; 78 constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1};
78 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.75}; 79 constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.75};
79 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35}; 80 constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35};
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 : kDefaultColorFrameInactive; 229 : kDefaultColorFrameInactive;
229 case COLOR_TOOLBAR: 230 case COLOR_TOOLBAR:
230 return otr ? kDefaultColorToolbarIncognito : kDefaultColorToolbar; 231 return otr ? kDefaultColorToolbarIncognito : kDefaultColorToolbar;
231 case COLOR_TAB_TEXT: 232 case COLOR_TAB_TEXT:
232 case COLOR_BOOKMARK_TEXT: 233 case COLOR_BOOKMARK_TEXT:
233 return otr ? kDefaultColorToolbarTextIncognito : kDefaultColorToolbarText; 234 return otr ? kDefaultColorToolbarTextIncognito : kDefaultColorToolbarText;
234 case COLOR_BACKGROUND_TAB_TEXT: 235 case COLOR_BACKGROUND_TAB_TEXT:
235 return otr ? kDefaultColorBackgroundTabTextIncognito 236 return otr ? kDefaultColorBackgroundTabTextIncognito
236 : kDefaultColorBackgroundTabText; 237 : kDefaultColorBackgroundTabText;
237 case COLOR_NTP_BACKGROUND: 238 case COLOR_NTP_BACKGROUND:
238 return kDefaultColorNTPBackground; 239 return otr ? kDefaultColorNTPBackgroundOtr : kDefaultColorNTPBackground;
239 case COLOR_NTP_TEXT: 240 case COLOR_NTP_TEXT:
240 return kDefaultColorNTPText; 241 return kDefaultColorNTPText;
241 case COLOR_NTP_LINK: 242 case COLOR_NTP_LINK:
242 return kDefaultColorNTPLink; 243 return kDefaultColorNTPLink;
243 case COLOR_NTP_HEADER: 244 case COLOR_NTP_HEADER:
244 return kDefaultColorNTPHeader; 245 return kDefaultColorNTPHeader;
245 case COLOR_BUTTON_BACKGROUND: 246 case COLOR_BUTTON_BACKGROUND:
246 return kDefaultColorButtonBackground; 247 return kDefaultColorButtonBackground;
247 248
248 // Properties not stored in theme pack. 249 // Properties not stored in theme pack.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 case COLOR_FRAME_INCOGNITO: 297 case COLOR_FRAME_INCOGNITO:
297 case COLOR_FRAME_INCOGNITO_INACTIVE: 298 case COLOR_FRAME_INCOGNITO_INACTIVE:
298 NOTREACHED() << "These values should be queried via their respective " 299 NOTREACHED() << "These values should be queried via their respective "
299 "non-incognito equivalents and an appropriate |otr| " 300 "non-incognito equivalents and an appropriate |otr| "
300 "value."; 301 "value.";
301 return gfx::kPlaceholderColor; 302 return gfx::kPlaceholderColor;
302 } 303 }
303 304
304 return gfx::kPlaceholderColor; 305 return gfx::kPlaceholderColor;
305 } 306 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/md_incognito_tab.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698