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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 19462009: [DRAFT] Allow a user to revert to their previous theme without closing infobar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e3ae62927c123d5db37d29f2cadeb040933930a4..f81cb7e9089c3dab2eac371570c6c4de42a4d3e1 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -66,8 +66,6 @@
#include "chrome/browser/extensions/updater/extension_updater.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/themes/theme_service.h"
-#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
#include "chrome/browser/ui/webui/theme_source.h"
@@ -1119,16 +1117,6 @@ void ExtensionService::NotifyExtensionUnloaded(
content::Source<Profile>(profile_),
content::Details<UnloadedExtensionInfo>(&details));
-#if defined(ENABLE_THEMES)
- // If the current theme is being unloaded, tell ThemeService to revert back
- // to the default theme.
- if (reason != extension_misc::UNLOAD_REASON_UPDATE && extension->is_theme()) {
- ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_);
- if (extension->id() == theme_service->GetThemeID())
- theme_service->UseDefaultTheme();
- }
-#endif
-
for (content::RenderProcessHost::iterator i(
content::RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
@@ -1950,15 +1938,6 @@ void ExtensionService::GarbageCollectExtensions() {
extension_paths))) {
NOTREACHED();
}
-
-#if defined(ENABLE_THEMES)
- // Also garbage-collect themes. We check |profile_| to be
- // defensive; in the future, we may call GarbageCollectExtensions()
- // from somewhere other than Init() (e.g., in a timer).
- if (profile_) {
- ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes();
- }
-#endif
}
void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) {
@@ -2521,20 +2500,6 @@ void ExtensionService::FinishInstallation(const Extension* extension) {
AddExtension(extension);
-#if defined(ENABLE_THEMES)
- // We do this here since AddExtension() is always called on browser startup,
- // and we only really care about the last theme installed.
- // If that ever changes and we have to move this code somewhere
- // else, it should be somewhere that's not in the startup path.
- if (extension->is_theme() && extensions_.GetByID(extension->id())) {
- DCHECK_EQ(extensions_.GetByID(extension->id()), extension);
- // Now that the theme extension is visible from outside the
- // ExtensionService, notify the ThemeService about the
- // newly-installed theme.
- ThemeServiceFactory::GetForProfile(profile_)->SetTheme(extension);
- }
-#endif
-
// If this is a new external extension that was disabled, alert the user
// so he can reenable it. We do this last so that it has already been
// added to our list of extensions.

Powered by Google App Engine
This is Rietveld 408576698