Chromium Code Reviews| Index: chrome/browser/themes/theme_service.cc |
| diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc |
| index bf6b9ccdd1b3a72c14528c4c59609c264a990d25..7e8d0676b5ab4a1b10b7e2f44911dbdb460f95c2 100644 |
| --- a/chrome/browser/themes/theme_service.cc |
| +++ b/chrome/browser/themes/theme_service.cc |
| @@ -14,8 +14,6 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/extensions/extension_system.h" |
| -#include "chrome/browser/managed_mode/managed_user_service.h" |
| -#include "chrome/browser/managed_mode/managed_user_service_factory.h" |
| #include "chrome/browser/managed_mode/managed_user_theme.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/themes/browser_theme_pack.h" |
| @@ -98,8 +96,13 @@ void ThemeService::Init(Profile* profile) { |
| DCHECK(CalledOnValidThread()); |
| profile_ = profile; |
| - ManagedUserServiceFactory::GetForProfile(profile)->AddInitCallback(base::Bind( |
| - &ThemeService::OnManagedUserInitialized, weak_ptr_factory_.GetWeakPtr())); |
| + if (!(theme_supplier_ && |
|
pkotwicz
2013/10/17 16:49:09
I do not think that this block is needed.
LoadThem
Bernhard Bauer
2013/10/17 16:55:03
Cool! Done.
|
| + (theme_supplier_->get_theme_type() == CustomThemeSupplier::EXTENSION || |
| + theme_supplier_->get_theme_type() == |
| + CustomThemeSupplier::MANAGED_USER_THEME)) && |
| + IsManagedUser()) { |
| + SetManagedUserTheme(); |
| + } |
| LoadThemePrefs(); |
| @@ -578,25 +581,6 @@ void ThemeService::SetManagedUserTheme() { |
| SetCustomDefaultTheme(new ManagedUserTheme); |
| } |
| -void ThemeService::OnManagedUserInitialized() { |
| - // Currently when creating a supervised user, the ThemeService is initialized |
| - // before the boolean flag indicating the profile belongs to a supervised |
| - // user gets set. In order to get the custom managed user theme, we get a |
| - // callback when ManagedUserService is initialized, which happens some time |
| - // after the boolean flag has been set in |
| - // ProfileManager::InitProfileUserPrefs() and after the |
| - // NOTIFICATION_EXTENSIONS_READY notification is sent. |
| - if ((theme_supplier_.get() && |
| - (theme_supplier_->get_theme_type() == CustomThemeSupplier::EXTENSION || |
| - theme_supplier_->get_theme_type() == |
| - CustomThemeSupplier::MANAGED_USER_THEME)) || |
| - !IsManagedUser()) { |
| - return; |
| - } |
| - |
| - SetManagedUserTheme(); |
| -} |
| - |
| void ThemeService::OnInfobarDisplayed() { |
| number_of_infobars_++; |
| } |