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

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

Issue 19471005: Add custom default theme support and create a managed user default theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bugs. Created 7 years, 5 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
Index: chrome/browser/themes/theme_service_factory.cc
diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc
index 92fe85cdd03146c9da63d1c0e66d54c213a424fe..58dbb9673bc18e56a2733c93e9741589f599da06 100644
--- a/chrome/browser/themes/theme_service_factory.cc
+++ b/chrome/browser/themes/theme_service_factory.cc
@@ -23,6 +23,11 @@
#include "ui/linux_ui/linux_ui.h"
#endif
+#if defined(ENABLE_MANAGED_USERS)
+#include "chrome/browser/managed_mode/managed_user_service.h"
+#include "chrome/browser/managed_mode/managed_user_theme.h"
+#endif
+
// static
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
return static_cast<ThemeService*>(
@@ -63,6 +68,13 @@ BrowserContextKeyedService* ThemeServiceFactory::BuildServiceInstanceFor(
#endif
provider->Init(static_cast<Profile*>(profile));
+#if defined(ENABLE_MANAGED_USERS)
+ if (ManagedUserService::ProfileIsManaged(static_cast<Profile*>(profile)) &&
+ provider->UsingDefaultTheme()) {
+ provider->SetCustomDefaultTheme(new ManagedUserTheme);
+ }
+#endif
+
return provider;
}

Powered by Google App Engine
This is Rietveld 408576698