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

Unified Diff: ui/views/controls/menu/menu_item_view_views.cc

Issue 9151011: Revert 116894 - Factor more colors into NativeTheme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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/views/controls/menu/menu_item_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_item_view_views.cc
===================================================================
--- ui/views/controls/menu/menu_item_view_views.cc (revision 116905)
+++ ui/views/controls/menu/menu_item_view_views.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,13 +10,20 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/favicon_size.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/views/controls/button/text_button.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_image_util.h"
#include "ui/views/controls/menu/submenu_view.h"
namespace views {
+// Background color when the menu item is selected.
+#if defined(OS_CHROMEOS)
+static const SkColor kSelectedBackgroundColor = SkColorSetRGB(0xDC, 0xE4, 0xFA);
+#else
+static const SkColor kSelectedBackgroundColor = SkColorSetRGB(246, 249, 253);
+#endif
+
void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
const MenuConfig& config = MenuConfig::instance();
bool render_selection =
@@ -35,11 +42,9 @@
// Render the background. As MenuScrollViewContainer draws the background, we
// only need the background when we want it to look different, as when we're
// selected.
- if (render_selection) {
- SkColor bg_color = gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
- canvas->GetSkCanvas()->drawColor(bg_color, SkXfermode::kSrc_Mode);
- }
+ if (render_selection)
+ canvas->GetSkCanvas()->drawColor(kSelectedBackgroundColor,
+ SkXfermode::kSrc_Mode);
// Render the check.
if (type_ == CHECKBOX && GetDelegate()->IsItemChecked(GetCommand())) {
@@ -63,10 +68,13 @@
}
// Render the foreground.
- SkColor fg_color = gfx::NativeTheme::instance()->GetSystemColor(
- enabled() ? gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor
- : gfx::NativeTheme::kColorId_DisabledMenuItemForegroundColor);
-
+#if defined(OS_CHROMEOS)
+ SkColor fg_color = enabled() ? SK_ColorBLACK
+ : SkColorSetRGB(0x80, 0x80, 0x80);
+#else
+ SkColor fg_color = enabled() ? TextButton::kEnabledColor
+ : TextButton::kDisabledColor;
+#endif
const gfx::Font& font = GetFont();
int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
int width = this->width() - item_right_margin_ - label_start_ - accel_width;
« no previous file with comments | « ui/views/controls/menu/menu_item_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698