| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "app/theme_provider.h" | |
| 14 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
| 15 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "ui/base/theme_provider.h" |
| 16 | 16 |
| 17 namespace color_utils { | 17 namespace color_utils { |
| 18 struct HSL; | 18 struct HSL; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class BrowserThemePack; | 21 class BrowserThemePack; |
| 22 class BrowserThemeProviderTest; | 22 class BrowserThemeProviderTest; |
| 23 class Extension; | 23 class Extension; |
| 24 class FilePath; | 24 class FilePath; |
| 25 class Profile; | 25 class Profile; |
| 26 class ResourceBundle; | 26 class ResourceBundle; |
| 27 | 27 |
| 28 #ifdef __OBJC__ | 28 #ifdef __OBJC__ |
| 29 @class NSString; | 29 @class NSString; |
| 30 // Sent whenever the browser theme changes. Object => NSValue wrapping the | 30 // Sent whenever the browser theme changes. Object => NSValue wrapping the |
| 31 // BrowserThemeProvider that changed. | 31 // BrowserThemeProvider that changed. |
| 32 extern "C" NSString* const kBrowserThemeDidChangeNotification; | 32 extern "C" NSString* const kBrowserThemeDidChangeNotification; |
| 33 #endif // __OBJC__ | 33 #endif // __OBJC__ |
| 34 | 34 |
| 35 class BrowserThemeProvider : public base::NonThreadSafe, | 35 class BrowserThemeProvider : public base::NonThreadSafe, |
| 36 public ThemeProvider { | 36 public ui::ThemeProvider { |
| 37 public: | 37 public: |
| 38 // Public constants used in BrowserThemeProvider and its subclasses: | 38 // Public constants used in BrowserThemeProvider and its subclasses: |
| 39 | 39 |
| 40 // Strings used in alignment properties. | 40 // Strings used in alignment properties. |
| 41 static const char* kAlignmentTop; | 41 static const char* kAlignmentTop; |
| 42 static const char* kAlignmentBottom; | 42 static const char* kAlignmentBottom; |
| 43 static const char* kAlignmentLeft; | 43 static const char* kAlignmentLeft; |
| 44 static const char* kAlignmentRight; | 44 static const char* kAlignmentRight; |
| 45 | 45 |
| 46 // Strings used in tiling properties. | 46 // Strings used in tiling properties. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } AlignmentMasks; | 123 } AlignmentMasks; |
| 124 | 124 |
| 125 // Background tiling choices. | 125 // Background tiling choices. |
| 126 typedef enum { | 126 typedef enum { |
| 127 NO_REPEAT = 0, | 127 NO_REPEAT = 0, |
| 128 REPEAT_X = 1, | 128 REPEAT_X = 1, |
| 129 REPEAT_Y = 2, | 129 REPEAT_Y = 2, |
| 130 REPEAT = 3 | 130 REPEAT = 3 |
| 131 } Tiling; | 131 } Tiling; |
| 132 | 132 |
| 133 // ThemeProvider implementation. | 133 // ui::ThemeProvider implementation. |
| 134 virtual void Init(Profile* profile); | 134 virtual void Init(Profile* profile); |
| 135 virtual SkBitmap* GetBitmapNamed(int id) const; | 135 virtual SkBitmap* GetBitmapNamed(int id) const; |
| 136 virtual SkColor GetColor(int id) const; | 136 virtual SkColor GetColor(int id) const; |
| 137 virtual bool GetDisplayProperty(int id, int* result) const; | 137 virtual bool GetDisplayProperty(int id, int* result) const; |
| 138 virtual bool ShouldUseNativeFrame() const; | 138 virtual bool ShouldUseNativeFrame() const; |
| 139 virtual bool HasCustomImage(int id) const; | 139 virtual bool HasCustomImage(int id) const; |
| 140 virtual RefCountedMemory* GetRawData(int id) const; | 140 virtual RefCountedMemory* GetRawData(int id) const; |
| 141 #if defined(TOOLKIT_USES_GTK) | 141 #if defined(TOOLKIT_USES_GTK) |
| 142 // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are | 142 // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are |
| 143 // shared instances owned by the theme provider and should not be freed. | 143 // shared instances owned by the theme provider and should not be freed. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |