| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 // Background tiling choices. | 134 // Background tiling choices. |
| 135 typedef enum { | 135 typedef enum { |
| 136 NO_REPEAT = 0, | 136 NO_REPEAT = 0, |
| 137 REPEAT_X = 1, | 137 REPEAT_X = 1, |
| 138 REPEAT_Y = 2, | 138 REPEAT_Y = 2, |
| 139 REPEAT = 3 | 139 REPEAT = 3 |
| 140 } Tiling; | 140 } Tiling; |
| 141 | 141 |
| 142 // ui::ThemeProvider implementation. | 142 // ui::ThemeProvider implementation. |
| 143 virtual void Init(Profile* profile); | 143 virtual void Init(Profile* profile) OVERRIDE; |
| 144 virtual SkBitmap* GetBitmapNamed(int id) const; | 144 virtual SkBitmap* GetBitmapNamed(int id) const OVERRIDE; |
| 145 virtual SkColor GetColor(int id) const; | 145 virtual SkColor GetColor(int id) const OVERRIDE; |
| 146 virtual bool GetDisplayProperty(int id, int* result) const; | 146 virtual bool GetDisplayProperty(int id, int* result) const OVERRIDE; |
| 147 virtual bool ShouldUseNativeFrame() const; | 147 virtual bool ShouldUseNativeFrame() const OVERRIDE; |
| 148 virtual bool HasCustomImage(int id) const; | 148 virtual bool HasCustomImage(int id) const OVERRIDE; |
| 149 virtual RefCountedMemory* GetRawData(int id) const; | 149 virtual RefCountedMemory* GetRawData(int id) const OVERRIDE; |
| 150 #if defined(TOOLKIT_USES_GTK) | 150 #if defined(TOOLKIT_USES_GTK) |
| 151 // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are | 151 // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are |
| 152 // shared instances owned by the theme provider and should not be freed. | 152 // shared instances owned by the theme provider and should not be freed. |
| 153 virtual GdkPixbuf* GetPixbufNamed(int id) const; | 153 virtual GdkPixbuf* GetPixbufNamed(int id) const OVERRIDE; |
| 154 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const; | 154 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const OVERRIDE; |
| 155 #elif defined(OS_MACOSX) | 155 #elif defined(OS_MACOSX) |
| 156 virtual NSImage* GetNSImageNamed(int id, bool allow_default) const; | 156 virtual NSImage* GetNSImageNamed(int id, bool allow_default) const OVERRIDE; |
| 157 virtual NSColor* GetNSImageColorNamed(int id, bool allow_default) const; | 157 virtual NSColor* GetNSImageColorNamed(int id, |
| 158 virtual NSColor* GetNSColor(int id, bool allow_default) const; | 158 bool allow_default) const OVERRIDE; |
| 159 virtual NSColor* GetNSColorTint(int id, bool allow_default) const; | 159 virtual NSColor* GetNSColor(int id, bool allow_default) const OVERRIDE; |
| 160 virtual NSGradient* GetNSGradient(int id) const; | 160 virtual NSColor* GetNSColorTint(int id, bool allow_default) const OVERRIDE; |
| 161 virtual NSGradient* GetNSGradient(int id) const OVERRIDE; |
| 161 #endif | 162 #endif |
| 162 | 163 |
| 163 // Set the current theme to the theme defined in |extension|. | 164 // Set the current theme to the theme defined in |extension|. |
| 164 virtual void SetTheme(const Extension* extension); | 165 virtual void SetTheme(const Extension* extension); |
| 165 | 166 |
| 166 // Reset the theme to default. | 167 // Reset the theme to default. |
| 167 virtual void UseDefaultTheme(); | 168 virtual void UseDefaultTheme(); |
| 168 | 169 |
| 169 // Set the current theme to the native theme. On some platforms, the native | 170 // Set the current theme to the native theme. On some platforms, the native |
| 170 // theme is the default theme. | 171 // theme is the default theme. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 245 |
| 245 // Clears the platform-specific caches. Do not call directly; it's called | 246 // Clears the platform-specific caches. Do not call directly; it's called |
| 246 // from ClearCaches(). | 247 // from ClearCaches(). |
| 247 virtual void FreePlatformCaches(); | 248 virtual void FreePlatformCaches(); |
| 248 | 249 |
| 249 Profile* profile() { return profile_; } | 250 Profile* profile() { return profile_; } |
| 250 | 251 |
| 251 // content::NotificationObserver: | 252 // content::NotificationObserver: |
| 252 virtual void Observe(int type, | 253 virtual void Observe(int type, |
| 253 const content::NotificationSource& source, | 254 const content::NotificationSource& source, |
| 254 const content::NotificationDetails& details); | 255 const content::NotificationDetails& details) OVERRIDE; |
| 255 | 256 |
| 256 private: | 257 private: |
| 257 friend class ThemeServiceTest; | 258 friend class ThemeServiceTest; |
| 258 | 259 |
| 259 // Saves the filename of the cached theme pack. | 260 // Saves the filename of the cached theme pack. |
| 260 void SavePackName(const FilePath& pack_path); | 261 void SavePackName(const FilePath& pack_path); |
| 261 | 262 |
| 262 // Save the id of the last theme installed. | 263 // Save the id of the last theme installed. |
| 263 void SaveThemeID(const std::string& id); | 264 void SaveThemeID(const std::string& id); |
| 264 | 265 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 293 | 294 |
| 294 // The number of infobars currently displayed. | 295 // The number of infobars currently displayed. |
| 295 int number_of_infobars_; | 296 int number_of_infobars_; |
| 296 | 297 |
| 297 content::NotificationRegistrar registrar_; | 298 content::NotificationRegistrar registrar_; |
| 298 | 299 |
| 299 DISALLOW_COPY_AND_ASSIGN(ThemeService); | 300 DISALLOW_COPY_AND_ASSIGN(ThemeService); |
| 300 }; | 301 }; |
| 301 | 302 |
| 302 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 303 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| OLD | NEW |