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

Side by Side Diff: ui/views/controls/menu/menu_item_view.cc

Issue 205153003: linux_aura: Don't inject black in WrenchMenu::GetForegroundColor(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nit Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/menu/menu_item_view.h" 5 #include "ui/views/controls/menu/menu_item_view.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 top_margin + 785 top_margin +
786 (height() - top_margin - bottom_margin - 786 (height() - top_margin - bottom_margin -
787 image.height()) / 2, 787 image.height()) / 2,
788 image.width(), 788 image.width(),
789 image.height()); 789 image.height());
790 AdjustBoundsForRTLUI(&radio_bounds); 790 AdjustBoundsForRTLUI(&radio_bounds);
791 canvas->DrawImageInt(image, radio_bounds.x(), radio_bounds.y()); 791 canvas->DrawImageInt(image, radio_bounds.x(), radio_bounds.y());
792 } 792 }
793 793
794 // Render the foreground. 794 // Render the foreground.
795 ui::NativeTheme::ColorId color_id = 795 ui::NativeTheme::ColorId color_id;
796 ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor;
797 if (enabled()) { 796 if (enabled()) {
798 color_id = render_selection ? 797 color_id = render_selection ?
799 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: 798 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor:
800 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; 799 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor;
800 } else {
801 color_id = delegate && delegate->GetBoldedDisabled(GetCommand()) ?
802 ui::NativeTheme::kColorId_BoldedDisabledMenuItemForegroundColor :
803 ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor;
801 } 804 }
802 SkColor fg_color = native_theme->GetSystemColor(color_id); 805 SkColor fg_color = native_theme->GetSystemColor(color_id);
803 SkColor override_foreground_color; 806 SkColor override_foreground_color;
804 if (delegate && delegate->GetForegroundColor(GetCommand(), 807 if (delegate && delegate->GetForegroundColor(GetCommand(),
805 render_selection, 808 render_selection,
806 &override_foreground_color)) 809 &override_foreground_color))
807 fg_color = override_foreground_color; 810 fg_color = override_foreground_color;
808 811
809 const gfx::FontList& font_list = GetFontList(); 812 const gfx::FontList& font_list = GetFontList();
810 int accel_width = parent_menu_item_->GetSubmenu()->max_minor_text_width(); 813 int accel_width = parent_menu_item_->GetSubmenu()->max_minor_text_width();
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 } else { 1063 } else {
1061 const Type& type = menu_item->GetType(); 1064 const Type& type = menu_item->GetType();
1062 if (type == CHECKBOX || type == RADIO) 1065 if (type == CHECKBOX || type == RADIO)
1063 return true; 1066 return true;
1064 } 1067 }
1065 } 1068 }
1066 return false; 1069 return false;
1067 } 1070 }
1068 1071
1069 } // namespace views 1072 } // namespace views
OLDNEW
« ui/views/controls/menu/menu_delegate.h ('K') | « ui/views/controls/menu/menu_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698