OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_THEME_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_THEMES_BROWSER_THEME_PROVIDER_H_ |
6 #define CHROME_BROWSER_THEMES_BROWSER_THEME_PROVIDER_H_ | 6 #define CHROME_BROWSER_THEMES_BROWSER_THEME_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // Returns the default color for the given color |id| COLOR_* enum value. | 198 // Returns the default color for the given color |id| COLOR_* enum value. |
199 static SkColor GetDefaultColor(int id); | 199 static SkColor GetDefaultColor(int id); |
200 | 200 |
201 // Returns true and sets |result| to the requested default property, if |id| | 201 // Returns true and sets |result| to the requested default property, if |id| |
202 // is valid. | 202 // is valid. |
203 static bool GetDefaultDisplayProperty(int id, int* result); | 203 static bool GetDefaultDisplayProperty(int id, int* result); |
204 | 204 |
205 // Returns the set of IDR_* resources that should be tinted. | 205 // Returns the set of IDR_* resources that should be tinted. |
206 static const std::set<int>& GetTintableToolbarButtons(); | 206 static const std::set<int>& GetTintableToolbarButtons(); |
207 | 207 |
| 208 // Remove preference values for themes that are no longer in use. |
| 209 void RemoveUnusedThemes(); |
| 210 |
208 // Save the images to be written to disk, mapping file path to id. | 211 // Save the images to be written to disk, mapping file path to id. |
209 typedef std::map<FilePath, int> ImagesDiskCache; | 212 typedef std::map<FilePath, int> ImagesDiskCache; |
210 | 213 |
211 protected: | 214 protected: |
212 // Get the specified tint - |id| is one of the TINT_* enum values. | 215 // Get the specified tint - |id| is one of the TINT_* enum values. |
213 color_utils::HSL GetTint(int id) const; | 216 color_utils::HSL GetTint(int id) const; |
214 | 217 |
215 // Clears all the override fields and saves the dictionary. | 218 // Clears all the override fields and saves the dictionary. |
216 virtual void ClearAllThemeData(); | 219 virtual void ClearAllThemeData(); |
217 | 220 |
(...skipping 22 matching lines...) Expand all Loading... |
240 // Saves the filename of the cached theme pack. | 243 // Saves the filename of the cached theme pack. |
241 void SavePackName(const FilePath& pack_path); | 244 void SavePackName(const FilePath& pack_path); |
242 | 245 |
243 // Save the id of the last theme installed. | 246 // Save the id of the last theme installed. |
244 void SaveThemeID(const std::string& id); | 247 void SaveThemeID(const std::string& id); |
245 | 248 |
246 // Implementation of SetTheme() (and the fallback from LoadThemePrefs() in | 249 // Implementation of SetTheme() (and the fallback from LoadThemePrefs() in |
247 // case we don't have a theme pack). | 250 // case we don't have a theme pack). |
248 void BuildFromExtension(const Extension* extension); | 251 void BuildFromExtension(const Extension* extension); |
249 | 252 |
250 // Remove preference values for themes that are no longer in use. | |
251 void RemoveUnusedThemes(); | |
252 | |
253 #if defined(TOOLKIT_USES_GTK) | 253 #if defined(TOOLKIT_USES_GTK) |
254 // Loads an image and flips it horizontally if |rtl_enabled| is true. | 254 // Loads an image and flips it horizontally if |rtl_enabled| is true. |
255 GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled) const; | 255 GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled) const; |
256 #endif | 256 #endif |
257 | 257 |
258 #if defined(TOOLKIT_USES_GTK) | 258 #if defined(TOOLKIT_USES_GTK) |
259 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; | 259 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; |
260 mutable GdkPixbufMap gdk_pixbufs_; | 260 mutable GdkPixbufMap gdk_pixbufs_; |
261 #elif defined(OS_MACOSX) | 261 #elif defined(OS_MACOSX) |
262 typedef std::map<int, NSImage*> NSImageMap; | 262 typedef std::map<int, NSImage*> NSImageMap; |
(...skipping 12 matching lines...) Expand all Loading... |
275 | 275 |
276 scoped_refptr<BrowserThemePack> theme_pack_; | 276 scoped_refptr<BrowserThemePack> theme_pack_; |
277 | 277 |
278 // The number of infobars currently displayed. | 278 // The number of infobars currently displayed. |
279 int number_of_infobars_; | 279 int number_of_infobars_; |
280 | 280 |
281 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); | 281 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); |
282 }; | 282 }; |
283 | 283 |
284 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PROVIDER_H_ | 284 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PROVIDER_H_ |
OLD | NEW |