| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_BASE_THEME_PROVIDER_H_ | 5 #ifndef UI_BASE_THEME_PROVIDER_H_ |
| 6 #define UI_BASE_THEME_PROVIDER_H_ | 6 #define UI_BASE_THEME_PROVIDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 typedef struct _GdkColor GdkColor; | 24 typedef struct _GdkColor GdkColor; |
| 25 typedef struct _GdkPixbuf GdkPixbuf; | 25 typedef struct _GdkPixbuf GdkPixbuf; |
| 26 #endif // OS_* | 26 #endif // OS_* |
| 27 | 27 |
| 28 class SkBitmap; | 28 class SkBitmap; |
| 29 | 29 |
| 30 namespace base { | 30 namespace base { |
| 31 class RefCountedMemory; | 31 class RefCountedMemory; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace gfx { |
| 35 class ImageSkia; |
| 36 } |
| 37 |
| 34 namespace ui { | 38 namespace ui { |
| 35 | 39 |
| 36 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 37 // | 41 // |
| 38 // ThemeProvider | 42 // ThemeProvider |
| 39 // | 43 // |
| 40 // ThemeProvider is an abstract class that defines the API that should be | 44 // ThemeProvider is an abstract class that defines the API that should be |
| 41 // implemented to provide bitmaps and color information for a given theme. | 45 // implemented to provide bitmaps and color information for a given theme. |
| 42 // | 46 // |
| 43 //////////////////////////////////////////////////////////////////////////////// | 47 //////////////////////////////////////////////////////////////////////////////// |
| 44 | 48 |
| 45 class UI_EXPORT ThemeProvider { | 49 class UI_EXPORT ThemeProvider { |
| 46 public: | 50 public: |
| 47 virtual ~ThemeProvider(); | 51 virtual ~ThemeProvider(); |
| 48 | 52 |
| 49 // Get the bitmap specified by |id|. An implementation of ThemeProvider should | 53 // Get the bitmap specified by |id|. An implementation of ThemeProvider should |
| 50 // have its own source of ids (e.g. an enum, or external resource bundle). | 54 // have its own source of ids (e.g. an enum, or external resource bundle). |
| 55 // TODO(pkotwicz): Get rid of GetBitmapNamed once all code uses |
| 56 // GetImageSkiaNamed. |
| 51 virtual SkBitmap* GetBitmapNamed(int id) const = 0; | 57 virtual SkBitmap* GetBitmapNamed(int id) const = 0; |
| 52 | 58 |
| 59 // Get the image specified by |id|. An implementation of ThemeProvider should |
| 60 // have its own source of ids (e.g. an enum, or external resource bundle). |
| 61 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const = 0; |
| 62 |
| 53 // Get the color specified by |id|. | 63 // Get the color specified by |id|. |
| 54 virtual SkColor GetColor(int id) const = 0; | 64 virtual SkColor GetColor(int id) const = 0; |
| 55 | 65 |
| 56 // Get the property (e.g. an alignment expressed in an enum, or a width or | 66 // Get the property (e.g. an alignment expressed in an enum, or a width or |
| 57 // height) specified by |id|. | 67 // height) specified by |id|. |
| 58 virtual bool GetDisplayProperty(int id, int* result) const = 0; | 68 virtual bool GetDisplayProperty(int id, int* result) const = 0; |
| 59 | 69 |
| 60 // Whether we should use the native system frame (typically Aero glass) or | 70 // Whether we should use the native system frame (typically Aero glass) or |
| 61 // a custom frame. | 71 // a custom frame. |
| 62 virtual bool ShouldUseNativeFrame() const = 0; | 72 virtual bool ShouldUseNativeFrame() const = 0; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // is missing. | 119 // is missing. |
| 110 | 120 |
| 111 // As above, but flips it in RTL locales. | 121 // As above, but flips it in RTL locales. |
| 112 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; | 122 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; |
| 113 #endif | 123 #endif |
| 114 }; | 124 }; |
| 115 | 125 |
| 116 } // namespace ui | 126 } // namespace ui |
| 117 | 127 |
| 118 #endif // UI_BASE_THEME_PROVIDER_H_ | 128 #endif // UI_BASE_THEME_PROVIDER_H_ |
| OLD | NEW |