| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 virtual SkColor GetColor(int id); | 153 virtual SkColor GetColor(int id); |
| 154 virtual bool GetDisplayProperty(int id, int* result); | 154 virtual bool GetDisplayProperty(int id, int* result); |
| 155 virtual bool ShouldUseNativeFrame(); | 155 virtual bool ShouldUseNativeFrame(); |
| 156 virtual bool HasCustomImage(int id); | 156 virtual bool HasCustomImage(int id); |
| 157 virtual bool GetRawData(int id, std::vector<unsigned char>* raw_data); | 157 virtual bool GetRawData(int id, std::vector<unsigned char>* raw_data); |
| 158 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 158 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 159 virtual GdkPixbuf* GetPixbufNamed(int id); | 159 virtual GdkPixbuf* GetPixbufNamed(int id); |
| 160 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id); | 160 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id); |
| 161 #elif defined(OS_MACOSX) | 161 #elif defined(OS_MACOSX) |
| 162 virtual NSImage* GetNSImageNamed(int id); | 162 virtual NSImage* GetNSImageNamed(int id); |
| 163 virtual NSColor* GetNSColor(int id); |
| 163 virtual NSColor* GetNSColorTint(int id); | 164 virtual NSColor* GetNSColorTint(int id); |
| 164 #endif | 165 #endif |
| 165 | 166 |
| 166 // Set the current theme to the theme defined in |extension|. | 167 // Set the current theme to the theme defined in |extension|. |
| 167 virtual void SetTheme(Extension* extension); | 168 virtual void SetTheme(Extension* extension); |
| 168 | 169 |
| 169 // Reset the theme to default. | 170 // Reset the theme to default. |
| 170 virtual void UseDefaultTheme(); | 171 virtual void UseDefaultTheme(); |
| 171 | 172 |
| 172 // Set the current theme to the native theme. On some platforms, the native | 173 // Set the current theme to the native theme. On some platforms, the native |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 typedef std::map<const std::string, skia::HSL> TintMap; | 236 typedef std::map<const std::string, skia::HSL> TintMap; |
| 236 typedef std::map<const std::string, int> DisplayPropertyMap; | 237 typedef std::map<const std::string, int> DisplayPropertyMap; |
| 237 typedef std::map<const int, std::vector<unsigned char> > RawDataMap; | 238 typedef std::map<const int, std::vector<unsigned char> > RawDataMap; |
| 238 | 239 |
| 239 // Returns the string key for the given tint |id| TINT_* enum value. | 240 // Returns the string key for the given tint |id| TINT_* enum value. |
| 240 const std::string GetTintKey(int id); | 241 const std::string GetTintKey(int id); |
| 241 | 242 |
| 242 // Returns the default tint for the given tint |id| TINT_* enum value. | 243 // Returns the default tint for the given tint |id| TINT_* enum value. |
| 243 skia::HSL GetDefaultTint(int id); | 244 skia::HSL GetDefaultTint(int id); |
| 244 | 245 |
| 246 // Returns the string key for the given color |id| COLOR_* enum value. |
| 247 const std::string GetColorKey(int id); |
| 248 |
| 249 // Returns the default color for the given color |id| COLOR_* enum value. |
| 250 SkColor GetDefaultColor(int id); |
| 251 |
| 245 // Get the specified tint - |id| is one of the TINT_* enum values. | 252 // Get the specified tint - |id| is one of the TINT_* enum values. |
| 246 skia::HSL GetTint(int id); | 253 skia::HSL GetTint(int id); |
| 247 | 254 |
| 248 // Tint |bitmap| with the tint specified by |hsl_id| | 255 // Tint |bitmap| with the tint specified by |hsl_id| |
| 249 SkBitmap TintBitmap(const SkBitmap& bitmap, int hsl_id); | 256 SkBitmap TintBitmap(const SkBitmap& bitmap, int hsl_id); |
| 250 | 257 |
| 251 // The following load data from specified dictionaries (either from | 258 // The following load data from specified dictionaries (either from |
| 252 // preferences or from an extension manifest) and update our theme | 259 // preferences or from an extension manifest) and update our theme |
| 253 // data appropriately. | 260 // data appropriately. |
| 254 // Allow any ResourceBundle image to be overridden. |images| should | 261 // Allow any ResourceBundle image to be overridden. |images| should |
| (...skipping 21 matching lines...) Expand all Loading... |
| 276 // Save our data - when saving images we need the original dictionary | 283 // Save our data - when saving images we need the original dictionary |
| 277 // from the extension because it contains the text ids that we want to save. | 284 // from the extension because it contains the text ids that we want to save. |
| 278 void SaveImageData(DictionaryValue* images); | 285 void SaveImageData(DictionaryValue* images); |
| 279 void SaveColorData(); | 286 void SaveColorData(); |
| 280 void SaveTintData(); | 287 void SaveTintData(); |
| 281 void SaveDisplayPropertyData(); | 288 void SaveDisplayPropertyData(); |
| 282 | 289 |
| 283 // Save the id of the last theme installed. | 290 // Save the id of the last theme installed. |
| 284 void SaveThemeID(const std::string& id); | 291 void SaveThemeID(const std::string& id); |
| 285 | 292 |
| 286 SkColor FindColor(const char* id, SkColor default_color); | |
| 287 | |
| 288 // Frees generated images and clears the image cache. | 293 // Frees generated images and clears the image cache. |
| 289 void ClearCaches(); | 294 void ClearCaches(); |
| 290 | 295 |
| 291 // Clears the platform-specific caches. Do not call directly; it's called | 296 // Clears the platform-specific caches. Do not call directly; it's called |
| 292 // from ClearCaches(). | 297 // from ClearCaches(). |
| 293 void FreePlatformCaches(); | 298 void FreePlatformCaches(); |
| 294 | 299 |
| 295 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 300 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 296 // Loads an image and flips it horizontally if |rtl_enabled| is true. | 301 // Loads an image and flips it horizontally if |rtl_enabled| is true. |
| 297 GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled); | 302 GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 318 ImageMap images_; | 323 ImageMap images_; |
| 319 ColorMap colors_; | 324 ColorMap colors_; |
| 320 TintMap tints_; | 325 TintMap tints_; |
| 321 RawDataMap raw_data_; | 326 RawDataMap raw_data_; |
| 322 DisplayPropertyMap display_properties_; | 327 DisplayPropertyMap display_properties_; |
| 323 | 328 |
| 324 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); | 329 DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); |
| 325 }; | 330 }; |
| 326 | 331 |
| 327 #endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ | 332 #endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ |
| OLD | NEW |