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

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

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: Address review comments. 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.h
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index b6d88696267ebb318459f68a2acea6dd0b853c27..30fb23a7f8747dd201a5e2ee5974c20e9d44f023 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -19,6 +19,7 @@
#include "content/public/browser/notification_registrar.h"
#include "ui/base/theme_provider.h"
+class CustomThemeSupplier;
class BrowserThemePack;
class ThemeServiceTest;
class ThemeSyncableService;
@@ -142,6 +143,13 @@ class ThemeService : public base::NonThreadSafe,
typedef std::map<base::FilePath, int> ImagesDiskCache;
protected:
+ // Set a custom default theme instead of the normal default theme.
+ virtual void SetCustomDefaultTheme(
+ scoped_refptr<CustomThemeSupplier> theme_supplier);
+
+ // If the native theme should be used as default.
pkotwicz 2013/07/19 18:33:20 How about: "Returns true if the ThemeService shoul
Adrian Kuegel 2013/07/22 12:58:08 Done.
+ virtual bool ShouldInitWithNativeTheme();
+
// Get the specified tint - |id| is one of the TINT_* enum values.
color_utils::HSL GetTint(int id) const;
@@ -167,9 +175,17 @@ class ThemeService : public base::NonThreadSafe,
void set_ready() { ready_ = true; }
+ const CustomThemeSupplier* GetThemeSupplier() const {
pkotwicz 2013/07/19 18:33:20 I think that get_theme_supplier() is the preferred
Adrian Kuegel 2013/07/22 12:58:08 Done.
+ return theme_supplier_.get();
+ }
+
private:
friend class ThemeServiceTest;
+ // Replace the current theme supplier with a new one and call StopUsingTheme
+ // or StartUsingTheme as appropriate.
pkotwicz 2013/07/19 18:33:20 Nit: StartUsingTheme(), StopUsingTheme().
Adrian Kuegel 2013/07/22 12:58:08 Done.
+ void SwapThemeSupplier(scoped_refptr<CustomThemeSupplier> theme_supplier);
+
// Migrate the theme to the new theme pack schema by recreating the data pack
// from the extension.
void MigrateTheme();
@@ -187,6 +203,8 @@ class ThemeService : public base::NonThreadSafe,
// Returns true if the profile belongs to a managed user.
bool IsManagedUser() const;
+ void SetManagedUserTheme();
pkotwicz 2013/07/19 18:33:20 Add a comment here.
Adrian Kuegel 2013/07/22 12:58:08 Done.
+
#if defined(TOOLKIT_GTK)
// Loads an image and flips it horizontally if |rtl_enabled| is true.
GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled) const;
@@ -215,7 +233,7 @@ class ThemeService : public base::NonThreadSafe,
// ThemeSource no longer uses the ThemeService when it is not ready.
bool ready_;
- scoped_refptr<BrowserThemePack> theme_pack_;
+ scoped_refptr<CustomThemeSupplier> theme_supplier_;
// The number of infobars currently displayed.
int number_of_infobars_;

Powered by Google App Engine
This is Rietveld 408576698