| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BROWSER_THEME_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ | 6 #define CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 COLOR_FRAME_INACTIVE, | 36 COLOR_FRAME_INACTIVE, |
| 37 COLOR_FRAME_INCOGNITO, | 37 COLOR_FRAME_INCOGNITO, |
| 38 COLOR_FRAME_INCOGNITO_INACTIVE, | 38 COLOR_FRAME_INCOGNITO_INACTIVE, |
| 39 COLOR_TOOLBAR, | 39 COLOR_TOOLBAR, |
| 40 COLOR_TAB_TEXT, | 40 COLOR_TAB_TEXT, |
| 41 COLOR_BACKGROUND_TAB_TEXT, | 41 COLOR_BACKGROUND_TAB_TEXT, |
| 42 COLOR_BOOKMARK_TEXT, | 42 COLOR_BOOKMARK_TEXT, |
| 43 COLOR_NTP_TEXT, | 43 COLOR_NTP_TEXT, |
| 44 COLOR_NTP_LINK, | 44 COLOR_NTP_LINK, |
| 45 COLOR_NTP_SECTION, | 45 COLOR_NTP_SECTION, |
| 46 COLOR_CONTROL_BACKGROUND, |
| 47 COLOR_BUTTON_BACKGROUND, |
| 46 TINT_BUTTONS, | 48 TINT_BUTTONS, |
| 47 TINT_FRAME, | 49 TINT_FRAME, |
| 48 TINT_FRAME_INACTIVE, | 50 TINT_FRAME_INACTIVE, |
| 49 TINT_FRAME_INCOGNITO, | 51 TINT_FRAME_INCOGNITO, |
| 50 TINT_FRAME_INCOGNITO_INACTIVE, | 52 TINT_FRAME_INCOGNITO_INACTIVE, |
| 51 TINT_BACKGROUND_TAB | 53 TINT_BACKGROUND_TAB |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 void Init(Profile* profile); | 56 void Init(Profile* profile); |
| 55 | 57 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void SaveImageData(DictionaryValue* images); | 116 void SaveImageData(DictionaryValue* images); |
| 115 void SaveColorData(); | 117 void SaveColorData(); |
| 116 void SaveTintData(); | 118 void SaveTintData(); |
| 117 | 119 |
| 118 // Let all the browser views know that themes have changed. | 120 // Let all the browser views know that themes have changed. |
| 119 void NotifyThemeChanged(); | 121 void NotifyThemeChanged(); |
| 120 | 122 |
| 121 // Load theme data from preferences. | 123 // Load theme data from preferences. |
| 122 void LoadThemePrefs(); | 124 void LoadThemePrefs(); |
| 123 | 125 |
| 126 SkColor FindColor(const char* id, SkColor default_color); |
| 127 |
| 124 // Frees generated images and clears the image cache. | 128 // Frees generated images and clears the image cache. |
| 125 void FreeImages(); | 129 void FreeImages(); |
| 126 | 130 |
| 127 // Cached images. We cache all retrieved and generated bitmaps and keep | 131 // Cached images. We cache all retrieved and generated bitmaps and keep |
| 128 // track of the pointers. | 132 // track of the pointers. |
| 129 typedef std::map<int, SkBitmap*> ImageCache; | 133 typedef std::map<int, SkBitmap*> ImageCache; |
| 130 ImageCache image_cache_; | 134 ImageCache image_cache_; |
| 131 #if defined(OS_LINUX) | 135 #if defined(OS_LINUX) |
| 132 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; | 136 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; |
| 133 GdkPixbufMap gdk_pixbufs_; | 137 GdkPixbufMap gdk_pixbufs_; |
| 134 #endif | 138 #endif |
| 135 | 139 |
| 136 // List of generate images that aren't stored in ResourceBundles image cache | 140 // List of generate images that aren't stored in ResourceBundles image cache |
| 137 // and need to be freed. | 141 // and need to be freed. |
| 138 std::vector<SkBitmap*> generated_images_; | 142 std::vector<SkBitmap*> generated_images_; |
| 139 | 143 |
| 140 ResourceBundle& rb_; | 144 ResourceBundle& rb_; |
| 141 Profile* profile_; | 145 Profile* profile_; |
| 142 | 146 |
| 143 ImageMap images_; | 147 ImageMap images_; |
| 144 ColorMap colors_; | 148 ColorMap colors_; |
| 145 TintMap tints_; | 149 TintMap tints_; |
| 146 | 150 |
| 147 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); | 151 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); |
| 148 }; | 152 }; |
| 149 | 153 |
| 150 #endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ | 154 #endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ |
| OLD | NEW |