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

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

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: Rebased Created 7 years, 4 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.h
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index 1452a9a8e0ba7dcdf216ef9cf9a911967f42c50f..37e951f51431f3db95dce34dc73919cbc1fe8573 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
@@ -135,8 +136,10 @@ class ThemeService : public base::NonThreadSafe,
// destroyed, uninstalls all themes that aren't the currently selected.
void OnInfobarDestroyed();
- // Remove preference values for themes that are no longer in use.
- void RemoveUnusedThemes();
+ // Uninstall theme extensions which are no longer in use. |ignore_infobars| is
+ // whether unused themes should be removed despite a theme infobar being
+ // visible.
+ void RemoveUnusedThemes(bool ignore_infobars);
// Returns the syncable service for syncing theme. The returned service is
// owned by |this| object.
@@ -185,14 +188,17 @@ class ThemeService : public base::NonThreadSafe,
private:
friend class theme_service_internal::ThemeServiceTest;
- // Replaces the current theme supplier with a new one and calls
- // StopUsingTheme() or StartUsingTheme() as appropriate.
- void SwapThemeSupplier(scoped_refptr<CustomThemeSupplier> theme_supplier);
+ // Called when the extension service is ready.
+ void OnExtensionServiceReady();
// Migrate the theme to the new theme pack schema by recreating the data pack
// from the extension.
void MigrateTheme();
+ // Replaces the current theme supplier with a new one and calls
+ // StopUsingTheme() or StartUsingTheme() as appropriate.
+ void SwapThemeSupplier(scoped_refptr<CustomThemeSupplier> theme_supplier);
+
// Saves the filename of the cached theme pack.
void SavePackName(const base::FilePath& pack_path);
@@ -240,6 +246,13 @@ class ThemeService : public base::NonThreadSafe,
scoped_refptr<CustomThemeSupplier> theme_supplier_;
+ // The id of the theme extension which has just been installed but has not
+ // been loaded yet. The theme extension with |installed_pending_load_id_| may
+ // never be loaded if the install is due to updating a disabled theme.
+ // |pending_install_id_| should be set to |kDefaultThemeID| if there are no
+ // recently installed theme extensions
+ std::string installed_pending_load_id_;
+
// The number of infobars currently displayed.
int number_of_infobars_;
@@ -247,6 +260,8 @@ class ThemeService : public base::NonThreadSafe,
scoped_ptr<ThemeSyncableService> theme_syncable_service_;
+ base::WeakPtrFactory<ThemeService> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ThemeService);
};

Powered by Google App Engine
This is Rietveld 408576698