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

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: also change gtk a little 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.
Peter Kasting 2017/01/17 20:51:25 It seems kind of random that we increase the lumin
Evan Stade 2017/01/18 00:16:59 In the dark case (e.g. incognito) it is actually m
Peter Kasting 2017/01/18 00:40:16 Which seems like a bug. Why would we want a stron
Evan Stade 2017/01/24 00:46:08 In practice, it doesn't look like a bug. You can t
Peter Kasting 2017/01/24 21:43:33 Staring at the current behavior more closely, I th
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);
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 25% of bookmark text color as separator color.
488 return SkColorSetA( 499 return color_utils::BlendTowardOppositeLuma(
489 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128); 500 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 0xBF);
Peter Kasting 2017/01/17 20:51:25 Doesn't blending toward the opposite luma here ass
Evan Stade 2017/01/18 00:16:59 I think it's a safe assumption that blending towar
Peter Kasting 2017/01/18 00:40:16 The effect of the previous alpha-blend was, basica
Evan Stade 2017/01/24 00:46:08 I'm not sure I follow because there's no way to pr
Peter Kasting 2017/01/24 21:43:33 I just meant, if we're trying to guarantee the sep
490 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT: 501 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT:
491 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30); 502 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30);
492 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER: 503 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER:
493 return GetColor(kNtpText, incognito); 504 return GetColor(kNtpText, incognito);
494 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE: 505 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE:
495 return IncreaseLightness(GetColor(kNtpText, incognito), 0.70); 506 return IncreaseLightness(GetColor(kNtpText, incognito), 0.70);
496 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE_LIGHT: 507 case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE_LIGHT:
497 return IncreaseLightness(GetColor(kNtpText, incognito), 0.86); 508 return IncreaseLightness(GetColor(kNtpText, incognito), 0.86);
498 case ThemeProperties::COLOR_NTP_TEXT_LIGHT: 509 case ThemeProperties::COLOR_NTP_TEXT_LIGHT:
499 return IncreaseLightness(GetColor(kNtpText, incognito), 0.40); 510 return IncreaseLightness(GetColor(kNtpText, incognito), 0.40);
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 886
876 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) 887 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
877 bool ThemeService::IsSupervisedUser() const { 888 bool ThemeService::IsSupervisedUser() const {
878 return profile_->IsSupervised(); 889 return profile_->IsSupervised();
879 } 890 }
880 891
881 void ThemeService::SetSupervisedUserTheme() { 892 void ThemeService::SetSupervisedUserTheme() {
882 SetCustomDefaultTheme(new SupervisedUserTheme); 893 SetCustomDefaultTheme(new SupervisedUserTheme);
883 } 894 }
884 #endif 895 #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