From b5d079536bcbf33c657fd96079bb7b2bd9644c0e Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Tue, 13 Oct 2009 20:00:09 +0000 Subject: Make the ThemeProvider methods const. BUG=none TEST=none Review URL: http://codereview.chromium.org/266037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28868 0039d316-1c4b-4281-b951-d872f2087c98 --- app/theme_provider.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'app/theme_provider.h') diff --git a/app/theme_provider.h b/app/theme_provider.h index f9a9bb5..c3b8a9c 100644 --- a/app/theme_provider.h +++ b/app/theme_provider.h @@ -43,26 +43,27 @@ class ThemeProvider { // Get the bitmap specified by |id|. An implementation of ThemeProvider should // have its own source of ids (e.g. an enum, or external resource bundle). - virtual SkBitmap* GetBitmapNamed(int id) = 0; + virtual SkBitmap* GetBitmapNamed(int id) const = 0; // Get the color specified by |id|. - virtual SkColor GetColor(int id) = 0; + virtual SkColor GetColor(int id) const = 0; // Get the property (e.g. an alignment expressed in an enum, or a width or // height) specified by |id|. - virtual bool GetDisplayProperty(int id, int* result) = 0; + virtual bool GetDisplayProperty(int id, int* result) const = 0; // Whether we should use the native system frame (typically Aero glass) or // a custom frame. - virtual bool ShouldUseNativeFrame() = 0; + virtual bool ShouldUseNativeFrame() const = 0; // Whether or not we have a certain image. Used for when the default theme // doesn't provide a certain image, but custom themes might (badges, etc). - virtual bool HasCustomImage(int id) = 0; + virtual bool HasCustomImage(int id) const = 0; // Reads the image data from the theme file into the specified vector. Returns // true on success. - virtual bool GetRawData(int id, std::vector* raw_data) = 0; + virtual bool GetRawData(int id, + std::vector* raw_data) const = 0; #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared @@ -73,28 +74,28 @@ class ThemeProvider { // assert in debug mode if it does not. On failure, this will return a // pointer to a shared empty placeholder bitmap so it will be visible what // is missing. - virtual GdkPixbuf* GetPixbufNamed(int id) = 0; + virtual GdkPixbuf* GetPixbufNamed(int id) const = 0; // As above, but flips it in RTL locales. - virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) = 0; + virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; #elif defined(OS_MACOSX) // Gets the NSImage with the specified |id|. // // The bitmap is not assumed to exist. If a theme does not provide an image, // this function will return nil. - virtual NSImage* GetNSImageNamed(int id) = 0; + virtual NSImage* GetNSImageNamed(int id) const = 0; // Gets the NSColor with the specified |id|. // // The color is not assumed to exist. If a theme does not provide an color, // this function will return nil. - virtual NSColor* GetNSColor(int id) = 0; + virtual NSColor* GetNSColor(int id) const = 0; // Gets the NSColor for tinting with the specified |id|. // // The tint is not assumed to exist. If a theme does not provide a tint with // that id, this function will return nil. - virtual NSColor* GetNSColorTint(int id) = 0; + virtual NSColor* GetNSColorTint(int id) const = 0; #endif }; -- cgit v1.1