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

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

Issue 2248103002: Reland: Replace CONTROL_BACKGROUND and DETACHED_BOOKMARK_BAR_BACKGROUND by COLOR_NTP_BACKGROUND (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Properly handle incognito browsing Created 4 years, 4 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 const color_utils::HSL kTint = {-1, -1, 0.42975}; 461 const color_utils::HSL kTint = {-1, -1, 0.42975};
462 const color_utils::HSL kTintIncognito = {-1, -1, 0.34375}; 462 const color_utils::HSL kTintIncognito = {-1, -1, 0.34375};
463 return color_utils::HSLShift( 463 return color_utils::HSLShift(
464 GetColor(ThemeProperties::COLOR_TOOLBAR, incognito), 464 GetColor(ThemeProperties::COLOR_TOOLBAR, incognito),
465 incognito ? kTintIncognito : kTint); 465 incognito ? kTintIncognito : kTint);
466 } 466 }
467 case ThemeProperties::COLOR_BOOKMARK_BAR_INSTRUCTIONS_TEXT: 467 case ThemeProperties::COLOR_BOOKMARK_BAR_INSTRUCTIONS_TEXT:
468 if (UsingDefaultTheme()) 468 if (UsingDefaultTheme())
469 break; 469 break;
470 return GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito); 470 return GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito);
471 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND:
472 if (UsingDefaultTheme())
473 break;
474 return GetColor(ThemeProperties::COLOR_TOOLBAR, incognito);
475 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR: 471 case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR:
476 if (UsingDefaultTheme()) 472 if (UsingDefaultTheme())
477 break; 473 break;
478 // Use 50% of bookmark text color as separator color. 474 // Use 50% of bookmark text color as separator color.
479 return SkColorSetA( 475 return SkColorSetA(
480 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128); 476 GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128);
481 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT: 477 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT:
482 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30); 478 return IncreaseLightness(GetColor(kNtpText, incognito), 0.30);
483 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER: 479 case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER:
484 return GetColor(kNtpText, incognito); 480 return GetColor(kNtpText, incognito);
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 869
874 #if defined(ENABLE_SUPERVISED_USERS) 870 #if defined(ENABLE_SUPERVISED_USERS)
875 bool ThemeService::IsSupervisedUser() const { 871 bool ThemeService::IsSupervisedUser() const {
876 return profile_->IsSupervised(); 872 return profile_->IsSupervised();
877 } 873 }
878 874
879 void ThemeService::SetSupervisedUserTheme() { 875 void ThemeService::SetSupervisedUserTheme() {
880 SetCustomDefaultTheme(new SupervisedUserTheme); 876 SetCustomDefaultTheme(new SupervisedUserTheme);
881 } 877 }
882 #endif 878 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698