summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 01:40:30 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 01:40:30 +0000
commitfd9c35f41bcab4966a5db8d24de812b1e9f87967 (patch)
treee896d02bd840995415ce362ff498c460f14e6601 /views
parent28fe69ab1bb9362a1ee105821ec4631b574417d3 (diff)
downloadchromium_src-fd9c35f41bcab4966a5db8d24de812b1e9f87967.zip
chromium_src-fd9c35f41bcab4966a5db8d24de812b1e9f87967.tar.gz
chromium_src-fd9c35f41bcab4966a5db8d24de812b1e9f87967.tar.bz2
Misc. cleanup for theme provider code, including:
* Use correct indentation/alignment in a number of places * Use early-return to avoid long code block indenting * Use for() instead of while() in cases where that's what the code is actually doing * Consistent naming for iterators ("foo_iter", "bar_iter" instead of sometimes that way and sometimes "found") * Use {} when needed, don't use when not * Do not use "else" after "return" * Shorten overly-verbose code * Pull some trivial functions into the header * Eliminate unused function * Use STLDeleteValues() helper where appropriate Some of this was originally in my patch that modified constness, but I've split it out to make that more sane. BUG=none TEST=none Review URL: http://codereview.chromium.org/272033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28771 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/default_theme_provider.cc14
-rw-r--r--views/widget/default_theme_provider.h13
2 files changed, 9 insertions, 18 deletions
diff --git a/views/widget/default_theme_provider.cc b/views/widget/default_theme_provider.cc
index 60dd310..9dba2c6 100644
--- a/views/widget/default_theme_provider.cc
+++ b/views/widget/default_theme_provider.cc
@@ -12,21 +12,10 @@
namespace views {
-void DefaultThemeProvider::Init(Profile* profile) {
-}
-
SkBitmap* DefaultThemeProvider::GetBitmapNamed(int id) {
return ResourceBundle::GetSharedInstance().GetBitmapNamed(id);
}
-SkColor DefaultThemeProvider::GetColor(int id) {
- // Return debugging-blue.
- return 0xff0000ff;
-}
-
-bool DefaultThemeProvider::GetDisplayProperty(int id, int* result) {
- return false;
-}
bool DefaultThemeProvider::ShouldUseNativeFrame() {
#if defined(OS_WIN)
return win_util::ShouldUseVistaFrame();
@@ -35,7 +24,4 @@ bool DefaultThemeProvider::ShouldUseNativeFrame() {
#endif
}
-bool DefaultThemeProvider::HasCustomImage(int id) {
- return false;
-}
} // namespace views
diff --git a/views/widget/default_theme_provider.h b/views/widget/default_theme_provider.h
index cc537b9..b344def 100644
--- a/views/widget/default_theme_provider.h
+++ b/views/widget/default_theme_provider.h
@@ -5,6 +5,8 @@
#ifndef VIEWS_DEFAULT_THEME_PROVIDER_H_
#define VIEWS_DEFAULT_THEME_PROVIDER_H_
+#include <vector>
+
#include "app/theme_provider.h"
#include "base/basictypes.h"
@@ -19,12 +21,15 @@ class DefaultThemeProvider : public ThemeProvider {
virtual ~DefaultThemeProvider() { };
// Overridden from ThemeProvider.
- virtual void Init(Profile* profile);
+ virtual void Init(Profile* profile) { }
virtual SkBitmap* GetBitmapNamed(int id);
- virtual SkColor GetColor(int id);
- virtual bool GetDisplayProperty(int id, int* result);
+ virtual SkColor GetColor(int id) {
+ // Return debugging-blue.
+ return 0xff0000ff;
+ }
+ virtual bool GetDisplayProperty(int id, int* result) { return false; }
virtual bool ShouldUseNativeFrame();
- virtual bool HasCustomImage(int id);
+ virtual bool HasCustomImage(int id) { return false; }
virtual bool GetRawData(int id, std::vector<unsigned char>* raw_data) {
return false;
}