Protect references to ThemeService* with ENABLE_THEMES

On android, ENABLE_THEMES and ENABLE_PROTECTOR_SERVICE are not defined.
This fixes some link errors for unit_tests.

BUG=117407
TEST=

Review URL: https://chromiumcodereview.appspot.com/10704148

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146028 0039d316-1c4b-4281-b951-d872f2087c98
parent 9c61f630
...@@ -1873,12 +1873,14 @@ void ExtensionService::GarbageCollectExtensions() { ...@@ -1873,12 +1873,14 @@ void ExtensionService::GarbageCollectExtensions() {
extension_paths))) extension_paths)))
NOTREACHED(); NOTREACHED();
#if defined(ENABLE_THEMES)
// Also garbage-collect themes. We check |profile_| to be // Also garbage-collect themes. We check |profile_| to be
// defensive; in the future, we may call GarbageCollectExtensions() // defensive; in the future, we may call GarbageCollectExtensions()
// from somewhere other than Init() (e.g., in a timer). // from somewhere other than Init() (e.g., in a timer).
if (profile_) { if (profile_) {
ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes(); ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes();
} }
#endif
} }
void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) { void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) {
......
...@@ -414,7 +414,9 @@ void ExtensionServiceTestBase::InitializeExtensionService( ...@@ -414,7 +414,9 @@ void ExtensionServiceTestBase::InitializeExtensionService(
chrome::RegisterUserPrefs(prefs); chrome::RegisterUserPrefs(prefs);
profile->SetPrefService(prefs); profile->SetPrefService(prefs);
#if defined(ENABLE_THEMES)
ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs);
#endif
PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs);
profile_.reset(profile); profile_.reset(profile);
......
...@@ -33,9 +33,13 @@ ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() ...@@ -33,9 +33,13 @@ ExtensionSystemSharedFactory::ExtensionSystemSharedFactory()
"ExtensionSystemShared", "ExtensionSystemShared",
ProfileDependencyManager::GetInstance()) { ProfileDependencyManager::GetInstance()) {
DependsOn(GlobalErrorServiceFactory::GetInstance()); DependsOn(GlobalErrorServiceFactory::GetInstance());
#if defined(ENABLE_THEMES)
DependsOn(ThemeServiceFactory::GetInstance()); DependsOn(ThemeServiceFactory::GetInstance());
#endif
#if defined(ENABLE_PROTECTOR_SERVICE)
// ProtectorService should be destroyed after us. // ProtectorService should be destroyed after us.
DependsOn(protector::ProtectorServiceFactory::GetInstance()); DependsOn(protector::ProtectorServiceFactory::GetInstance());
#endif
} }
ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment