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

Unified Diff: ui/views/controls/label.cc

Issue 10270021: Make all the menu UI consitent with the new chromeos menu spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Give back the text_color initialization in menu_config.cc. Created 8 years, 8 months 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
« no previous file with comments | « ui/gfx/native_theme_win.cc ('k') | ui/views/controls/menu/menu_config_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index f42289e461eadbd0dafaf676f728b8cc156fa670..ac40fe5827c4f92f078ba2bb9246a6dcc1d02e0d 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/font.h"
#include "ui/gfx/insets.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/background.h"
namespace views {
@@ -355,31 +356,15 @@ gfx::Font Label::GetDefaultFont() {
}
void Label::Init(const string16& text, const gfx::Font& font) {
- static bool initialized = false;
- static SkColor kDefaultEnabledColor;
- static SkColor kDefaultDisabledColor;
- static SkColor kDefaultBackgroundColor;
- if (!initialized) {
-#if defined(OS_WIN)
- kDefaultEnabledColor = color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
- kDefaultDisabledColor = color_utils::GetSysSkColor(COLOR_GRAYTEXT);
- kDefaultBackgroundColor = color_utils::GetSysSkColor(COLOR_WINDOW);
-#else
- // TODO(beng): source from theme provider.
- kDefaultEnabledColor = SK_ColorBLACK;
- kDefaultDisabledColor = SK_ColorGRAY;
- kDefaultBackgroundColor = SK_ColorWHITE;
-#endif
-
- initialized = true;
- }
-
contains_mouse_ = false;
font_ = font;
text_size_valid_ = false;
- requested_enabled_color_ = kDefaultEnabledColor;
- requested_disabled_color_ = kDefaultDisabledColor;
- background_color_ = kDefaultBackgroundColor;
+ requested_enabled_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelEnabledColor);
+ requested_disabled_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelDisabledColor);
+ background_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelBackgroundColor);
auto_color_readability_ = true;
RecalculateColors();
horiz_alignment_ = ALIGN_CENTER;
« no previous file with comments | « ui/gfx/native_theme_win.cc ('k') | ui/views/controls/menu/menu_config_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698