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

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

Issue 1761183002: color_utils cleanup: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 : ui::NativeTheme::kColorId_ThrobberWaitingColor, 464 : ui::NativeTheme::kColorId_ThrobberWaitingColor,
465 nullptr); 465 nullptr);
466 color_utils::HSL hsl = GetTint(ThemeProperties::TINT_BUTTONS, incognito); 466 color_utils::HSL hsl = GetTint(ThemeProperties::TINT_BUTTONS, incognito);
467 return color_utils::HSLShift(base_color, hsl); 467 return color_utils::HSLShift(base_color, hsl);
468 } 468 }
469 #if defined(ENABLE_SUPERVISED_USERS) 469 #if defined(ENABLE_SUPERVISED_USERS)
470 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL: 470 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL:
471 return color_utils::GetReadableColor( 471 return color_utils::GetReadableColor(
472 SK_ColorWHITE, GetColor(kLabelBackground, incognito)); 472 SK_ColorWHITE, GetColor(kLabelBackground, incognito));
473 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: 473 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND:
474 return color_utils::BlendTowardOppositeLuminance( 474 return color_utils::BlendTowardOppositeLuma(
475 GetColor(ThemeProperties::COLOR_FRAME, incognito), 0x80); 475 GetColor(ThemeProperties::COLOR_FRAME, incognito), 0x80);
476 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BORDER: 476 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BORDER:
477 return color_utils::AlphaBlend(GetColor(kLabelBackground, incognito), 477 return color_utils::AlphaBlend(GetColor(kLabelBackground, incognito),
478 SK_ColorBLACK, 230); 478 SK_ColorBLACK, 230);
479 #endif 479 #endif
480 case ThemeProperties::COLOR_STATUS_BAR_TEXT: { 480 case ThemeProperties::COLOR_STATUS_BAR_TEXT: {
481 // A long time ago, we blended the toolbar and the tab text together to 481 // A long time ago, we blended the toolbar and the tab text together to
482 // get the status bar text because, at the time, our text rendering in 482 // get the status bar text because, at the time, our text rendering in
483 // views couldn't do alpha blending. Even though this is no longer the 483 // views couldn't do alpha blending. Even though this is no longer the
484 // case, this blending decision is built into the majority of themes that 484 // case, this blending decision is built into the majority of themes that
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 794
795 #if defined(ENABLE_SUPERVISED_USERS) 795 #if defined(ENABLE_SUPERVISED_USERS)
796 bool ThemeService::IsSupervisedUser() const { 796 bool ThemeService::IsSupervisedUser() const {
797 return profile_->IsSupervised(); 797 return profile_->IsSupervised();
798 } 798 }
799 799
800 void ThemeService::SetSupervisedUserTheme() { 800 void ThemeService::SetSupervisedUserTheme() {
801 SetCustomDefaultTheme(new SupervisedUserTheme); 801 SetCustomDefaultTheme(new SupervisedUserTheme);
802 } 802 }
803 #endif 803 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698