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

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

Issue 1813393002: Don't fall back to default incognito colors and tints when using a (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
« no previous file with comments | « no previous file | 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) 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 SK_ColorWHITE, GetColor(kLabelBackground, incognito)); 488 SK_ColorWHITE, GetColor(kLabelBackground, incognito));
489 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: 489 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND:
490 return color_utils::BlendTowardOppositeLuma( 490 return color_utils::BlendTowardOppositeLuma(
491 GetColor(ThemeProperties::COLOR_FRAME, incognito), 0x80); 491 GetColor(ThemeProperties::COLOR_FRAME, incognito), 0x80);
492 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BORDER: 492 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BORDER:
493 return color_utils::AlphaBlend(GetColor(kLabelBackground, incognito), 493 return color_utils::AlphaBlend(GetColor(kLabelBackground, incognito),
494 SK_ColorBLACK, 230); 494 SK_ColorBLACK, 230);
495 #endif 495 #endif
496 } 496 }
497 497
498 return ThemeProperties::GetDefaultColor(id, incognito); 498 // Always fall back to the non-incognito color when there's a custom theme.
499 return ThemeProperties::GetDefaultColor(id, incognito && !theme_supplier_);
Peter Kasting 2016/03/18 20:53:50 Hmm. Couldn't this also break some themes, if we
Evan Stade 2016/03/18 21:15:21 Perhaps, but I checked about 8 themes and the only
Peter Kasting 2016/03/18 21:22:53 No; instead I think we should only disable |use_in
499 } 500 }
500 501
501 color_utils::HSL ThemeService::GetTint(int id, bool incognito) const { 502 color_utils::HSL ThemeService::GetTint(int id, bool incognito) const {
502 DCHECK(CalledOnValidThread()); 503 DCHECK(CalledOnValidThread());
503 504
504 color_utils::HSL hsl; 505 color_utils::HSL hsl;
505 if (theme_supplier_ && theme_supplier_->GetTint(id, &hsl)) 506 if (theme_supplier_ && theme_supplier_->GetTint(id, &hsl))
506 return hsl; 507 return hsl;
507 508
508 return ThemeProperties::GetDefaultTint(id, incognito); 509 // Always fall back to the non-incognito tint when there's a custom theme.
510 return ThemeProperties::GetDefaultTint(id, incognito && !theme_supplier_);
509 } 511 }
510 512
511 void ThemeService::ClearAllThemeData() { 513 void ThemeService::ClearAllThemeData() {
512 if (!ready_) 514 if (!ready_)
513 return; 515 return;
514 516
515 SwapThemeSupplier(nullptr); 517 SwapThemeSupplier(nullptr);
516 518
517 // Clear our image cache. 519 // Clear our image cache.
518 FreePlatformCaches(); 520 FreePlatformCaches();
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 853
852 #if defined(ENABLE_SUPERVISED_USERS) 854 #if defined(ENABLE_SUPERVISED_USERS)
853 bool ThemeService::IsSupervisedUser() const { 855 bool ThemeService::IsSupervisedUser() const {
854 return profile_->IsSupervised(); 856 return profile_->IsSupervised();
855 } 857 }
856 858
857 void ThemeService::SetSupervisedUserTheme() { 859 void ThemeService::SetSupervisedUserTheme() {
858 SetCustomDefaultTheme(new SupervisedUserTheme); 860 SetCustomDefaultTheme(new SupervisedUserTheme);
859 } 861 }
860 #endif 862 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698