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

Unified Diff: chrome/browser/themes/theme_service.cc

Issue 355233002: Fix build when ENABLE_MANAGED_USERS is not defined (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include missing browsertest .js file in chrome_tests.gypi Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 886521a65c184444b75aacb7bac4d77d0a0a2310..cecfd45905cb8345fd607d00210d32e1533e012f 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -16,7 +16,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"
@@ -36,6 +35,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
@@ -168,6 +171,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,
@@ -180,6 +184,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
@@ -395,10 +400,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();
}
@@ -454,10 +461,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();
@@ -604,6 +616,7 @@ void ThemeService::BuildFromExtension(const Extension* extension) {
SwapThemeSupplier(pack);
}
+#if defined(ENABLE_MANAGED_USERS)
bool ThemeService::IsSupervisedUser() const {
return profile_->IsSupervised();
}
@@ -611,6 +624,7 @@ bool ThemeService::IsSupervisedUser() const {
void ThemeService::SetSupervisedUserTheme() {
SetCustomDefaultTheme(new SupervisedUserTheme);
}
+#endif
void ThemeService::OnInfobarDisplayed() {
number_of_infobars_++;
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698