Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: ui/gfx/native_theme_base.cc

Issue 8597015: Add a new GetSystemColor method to native theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/native_theme_base.cc
diff --git a/ui/gfx/native_theme_base.cc b/ui/gfx/native_theme_base.cc
index 95ba5aa1e681b1856e4f246b1c6837bab2157c68..715f62a6f1c97ab9352697da0cc27a6a88475ddc 100644
--- a/ui/gfx/native_theme_base.cc
+++ b/ui/gfx/native_theme_base.cc
@@ -14,6 +14,14 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
+namespace {
+
+// Hardcoded colors for use when there is no system theme (Aura, ChromeOS).
+const SkColor kDefaultDialogBackgroundColor = SkColorSetRGB(200, 200, 200);
+const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
+
+} // namespace
+
namespace gfx {
unsigned int NativeThemeBase::button_length_ = 14;
@@ -57,6 +65,19 @@ NativeThemeBase::NativeThemeBase() {
NativeThemeBase::~NativeThemeBase() {
}
+// This implementation returns hardcoded colors. It's used by NativeThemeAura
+// and NativeThemeChromeos and overridden by NativeThemeGtk.
Ben Goodger (Google) 2011/11/21 18:59:59 comment moves inside function.
benrg 2011/11/21 19:54:20 Done.
+SkColor NativeThemeBase::GetSystemColor(ColorId color_id) const {
Ben Goodger (Google) 2011/11/21 18:59:59 order in .cc must match .h
benrg 2011/11/21 19:54:20 Independently for each protection level, I guess;
Ben Goodger (Google) 2011/11/22 15:49:50 Sort of, it's in the Chrome-specific overrides: h
benrg 2011/11/22 21:43:49 In the newest patch set, NativeThemeBase::GetSyste
+ switch (color_id) {
+ case kDialogBackgroundColorId:
+ return kDefaultDialogBackgroundColor;
+ default:
+ NOTREACHED() << "Invalid color_id: " << color_id;
+ break;
+ }
+ return kInvalidColorIdColor;
+}
+
gfx::Size NativeThemeBase::GetPartSize(Part part,
State state,
const ExtraParams& extra) const {

Powered by Google App Engine
This is Rietveld 408576698