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

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

Issue 2629293002: Try to improve toolbar separator coloration for themed browser windows. (Closed)
Patch Set: revert Created 3 years, 11 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/theme_properties.cc ('k') | chrome/browser/ui/libgtkui/gtk_ui.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 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 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_service.h" 5 #include "chrome/browser/themes/theme_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 const color_utils::HSL kTint = {-1, -1, 0.42975}; 470 const color_utils::HSL kTint = {-1, -1, 0.42975};
471 const color_utils::HSL kTintIncognito = {-1, -1, 0.34375}; 471 const color_utils::HSL kTintIncognito = {-1, -1, 0.34375};
472 return color_utils::HSLShift( 472 return color_utils::HSLShift(
473 GetColor(ThemeProperties::COLOR_TOOLBAR, incognito), 473 GetColor(ThemeProperties::COLOR_TOOLBAR, incognito),
474 incognito ? kTintIncognito : kTint); 474 incognito ? kTintIncognito : kTint);
475 } 475 }
476 case ThemeProperties::COLOR_BOOKMARK_BAR_INSTRUCTIONS_TEXT: 476 case ThemeProperties::COLOR_BOOKMARK_BAR_INSTRUCTIONS_TEXT:
477 if (UsingDefaultTheme()) 477 if (UsingDefaultTheme())
478 break; 478 break;
479 return GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito); 479 return GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito);
480 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR: {
481 // Same as the normal toolbar separator, but with increased luminance.
482 // Either double it or halve the distance to 1.0, whichever is less of a
483 // difference.
484 color_utils::HSL hsl;
485 color_utils::SkColorToHSL(
486 GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR, incognito),
487 &hsl);
488 hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2);
489 return color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE);
490 }
480 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND: 491 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND:
481 if (UsingDefaultTheme()) 492 if (UsingDefaultTheme())
482 break; 493 break;
483 return GetColor(ThemeProperties::COLOR_TOOLBAR, incognito); 494 return GetColor(ThemeProperties::COLOR_TOOLBAR, incognito);
Evan Stade 2017/01/24 00:46:08 tangent: I noticed that on many themes this is bet
Peter Kasting 2017/01/24 21:43:33 I agree; see https://bugs.chromium.org/p/chromium/
484 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR: 495 case ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR:
485 if (UsingDefaultTheme()) 496 if (UsingDefaultTheme())
486 break; 497 break;
487 // Use 50% of bookmark text color as separator color. 498 // Use 12.5% of bookmark text color as separator color.
488 return SkColorSetA( 499 return color_utils::AlphaBlend(
489 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128); 500 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito),
501 GetColor(ThemeProperties::COLOR_TOOLBAR, incognito), 0x20);
490 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT: 502 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT:
491 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30); 503 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30);
492 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER: 504 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER:
493 return GetColor(kNtpText, incognito); 505 return GetColor(kNtpText, incognito);
494 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE: 506 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE:
495 return IncreaseLightness(GetColor(kNtpText, incognito), 0.70); 507 return IncreaseLightness(GetColor(kNtpText, incognito), 0.70);
496 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE_LIGHT: 508 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE_LIGHT:
497 return IncreaseLightness(GetColor(kNtpText, incognito), 0.86); 509 return IncreaseLightness(GetColor(kNtpText, incognito), 0.86);
498 case ThemeProperties::COLOR_NTP_TEXT_LIGHT: 510 case ThemeProperties::COLOR_NTP_TEXT_LIGHT:
499 return IncreaseLightness(GetColor(kNtpText, incognito), 0.40); 511 return IncreaseLightness(GetColor(kNtpText, incognito), 0.40);
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 887
876 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) 888 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
877 bool ThemeService::IsSupervisedUser() const { 889 bool ThemeService::IsSupervisedUser() const {
878 return profile_->IsSupervised(); 890 return profile_->IsSupervised();
879 } 891 }
880 892
881 void ThemeService::SetSupervisedUserTheme() { 893 void ThemeService::SetSupervisedUserTheme() {
882 SetCustomDefaultTheme(new SupervisedUserTheme); 894 SetCustomDefaultTheme(new SupervisedUserTheme);
883 } 895 }
884 #endif 896 #endif
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_properties.cc ('k') | chrome/browser/ui/libgtkui/gtk_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698