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

Unified Diff: chrome/browser/themes/theme_properties.cc

Issue 2899053002: Fix the MD Incognito NTP background color regression (Closed)
Patch Set: Addressed comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_properties.cc
diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc
index ea03e3f3a37c72411ff67d71225aacc3f94a58f7..92c01231f6a45d121056567221d4c22326253175 100644
--- a/chrome/browser/themes/theme_properties.cc
+++ b/chrome/browser/themes/theme_properties.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "chrome/browser/themes/browser_theme_pack.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/grit/theme_resources.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/gfx/color_palette.h"
@@ -67,7 +68,11 @@ constexpr SkColor kDefaultColorNTPBackground = SK_ColorWHITE;
constexpr SkColor kDefaultColorNTPText = SK_ColorBLACK;
const SkColor kDefaultColorNTPLink = SkColorSetRGB(0x06, 0x37, 0x74);
#endif // OS_WIN
-const SkColor kDefaultColorNTPBackgroundOtr = SkColorSetRGB(0x30, 0x30, 0x30);
+
+// Then new MD Incognito NTP uses a slightly different shade of black.
+// TODO(msramek): Remove the old entry when the new NTP fully launches.
Evan Stade 2017/05/24 17:30:26 nit: I don't really mind if you leave this TODO he
msramek 2017/05/24 17:39:49 I just imagined that having two background colors
+const SkColor kDefaultColorNTPBackgroundOtr = SkColorSetRGB(0x32, 0x32, 0x32);
+const SkColor kDefaultColorNTPBackgroundOtrMD = SkColorSetRGB(0x30, 0x30, 0x30);
const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96);
constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT;
@@ -236,7 +241,11 @@ SkColor ThemeProperties::GetDefaultColor(int id, bool otr) {
return otr ? kDefaultColorBackgroundTabTextIncognito
: kDefaultColorBackgroundTabText;
case COLOR_NTP_BACKGROUND:
- return otr ? kDefaultColorNTPBackgroundOtr : kDefaultColorNTPBackground;
+ if (!otr)
+ return kDefaultColorNTPBackground;
+ return base::FeatureList::IsEnabled(features::kMaterialDesignIncognitoNTP)
+ ? kDefaultColorNTPBackgroundOtrMD
+ : kDefaultColorNTPBackgroundOtr;
case COLOR_NTP_TEXT:
return kDefaultColorNTPText;
case COLOR_NTP_LINK:
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698