| Index: chrome/browser/themes/theme_service.cc
|
| diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
|
| index 5d4f0b3fa24a2c5b4ec33392b97333aafb400aff..ed94edafab9cd72708723e787e283638ee90cab7 100644
|
| --- a/chrome/browser/themes/theme_service.cc
|
| +++ b/chrome/browser/themes/theme_service.cc
|
| @@ -14,7 +14,6 @@
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/extensions/extension_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/supervised_user/supervised_user_theme.h"
|
| #include "chrome/browser/themes/browser_theme_pack.h"
|
| #include "chrome/browser/themes/custom_theme_supplier.h"
|
| #include "chrome/browser/themes/theme_properties.h"
|
| @@ -34,6 +33,10 @@
|
| #include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/image/image_skia.h"
|
|
|
| +#if defined(ENABLE_MANAGED_USERS)
|
| +#include "chrome/browser/supervised_user/supervised_user_theme.h"
|
| +#endif
|
| +
|
| #if defined(OS_WIN)
|
| #include "ui/base/win/shell.h"
|
| #endif
|
| @@ -151,6 +154,7 @@ SkColor ThemeService::GetColor(int id) const {
|
| return IncreaseLightness(GetColor(Properties::COLOR_NTP_TEXT), 0.86);
|
| case Properties::COLOR_NTP_TEXT_LIGHT:
|
| return IncreaseLightness(GetColor(Properties::COLOR_NTP_TEXT), 0.40);
|
| +#if defined(ENABLE_MANAGED_USERS)
|
| case Properties::COLOR_SUPERVISED_USER_LABEL:
|
| return color_utils::GetReadableColor(
|
| SK_ColorWHITE,
|
| @@ -163,6 +167,7 @@ SkColor ThemeService::GetColor(int id) const {
|
| GetColor(Properties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND),
|
| SK_ColorBLACK,
|
| 230);
|
| +#endif
|
| case Properties::COLOR_STATUS_BAR_TEXT: {
|
| // A long time ago, we blended the toolbar and the tab text together to
|
| // get the status bar text because, at the time, our text rendering in
|
| @@ -377,10 +382,12 @@ void ThemeService::RemoveUnusedThemes(bool ignore_infobars) {
|
| void ThemeService::UseDefaultTheme() {
|
| if (ready_)
|
| content::RecordAction(UserMetricsAction("Themes_Reset"));
|
| +#if defined(ENABLE_MANAGED_USERS)
|
| if (IsSupervisedUser()) {
|
| SetSupervisedUserTheme();
|
| return;
|
| }
|
| +#endif
|
| ClearAllThemeData();
|
| NotifyThemeChanged();
|
| }
|
| @@ -436,10 +443,15 @@ void ThemeService::LoadThemePrefs() {
|
|
|
| std::string current_id = GetThemeID();
|
| if (current_id == kDefaultThemeID) {
|
| +#if defined(ENABLE_MANAGED_USERS)
|
| // Supervised users have a different default theme.
|
| - if (IsSupervisedUser())
|
| + if (IsSupervisedUser()) {
|
| SetSupervisedUserTheme();
|
| - else if (ShouldInitWithSystemTheme())
|
| + set_ready();
|
| + return;
|
| + }
|
| +#endif
|
| + if (ShouldInitWithSystemTheme())
|
| UseSystemTheme();
|
| else
|
| UseDefaultTheme();
|
| @@ -585,6 +597,7 @@ void ThemeService::BuildFromExtension(const Extension* extension) {
|
| SwapThemeSupplier(pack);
|
| }
|
|
|
| +#if defined(ENABLE_MANAGED_USERS)
|
| bool ThemeService::IsSupervisedUser() const {
|
| return profile_->IsSupervised();
|
| }
|
| @@ -592,6 +605,7 @@ bool ThemeService::IsSupervisedUser() const {
|
| void ThemeService::SetSupervisedUserTheme() {
|
| SetCustomDefaultTheme(new SupervisedUserTheme);
|
| }
|
| +#endif
|
|
|
| void ThemeService::OnInfobarDisplayed() {
|
| number_of_infobars_++;
|
|
|