| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 const int bottom_margin = GetBottomMargin(); | 776 const int bottom_margin = GetBottomMargin(); |
| 777 const int available_height = height() - top_margin - bottom_margin; | 777 const int available_height = height() - top_margin - bottom_margin; |
| 778 | 778 |
| 779 // Calculate some colors. | 779 // Calculate some colors. |
| 780 ui::NativeTheme::ColorId color_id; | 780 ui::NativeTheme::ColorId color_id; |
| 781 if (enabled()) { | 781 if (enabled()) { |
| 782 color_id = render_selection ? | 782 color_id = render_selection ? |
| 783 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 783 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
| 784 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; | 784 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; |
| 785 } else { | 785 } else { |
| 786 bool emphasized = delegate && | 786 bool emphasized = |
| 787 delegate->GetShouldUseDisabledEmphasizedForegroundColor( | 787 delegate && delegate->GetShouldUseNormalForegroundColor(GetCommand()); |
| 788 GetCommand()); | 788 color_id = emphasized |
| 789 color_id = emphasized ? | 789 ? ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor |
| 790 ui::NativeTheme::kColorId_DisabledEmphasizedMenuItemForegroundColor : | 790 : ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor; |
| 791 ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor; | |
| 792 } | 791 } |
| 793 SkColor fg_color = native_theme->GetSystemColor(color_id); | 792 SkColor fg_color = native_theme->GetSystemColor(color_id); |
| 794 SkColor override_foreground_color; | 793 SkColor override_foreground_color; |
| 795 if (delegate && delegate->GetForegroundColor(GetCommand(), | 794 if (delegate && delegate->GetForegroundColor(GetCommand(), |
| 796 render_selection, | 795 render_selection, |
| 797 &override_foreground_color)) { | 796 &override_foreground_color)) { |
| 798 fg_color = override_foreground_color; | 797 fg_color = override_foreground_color; |
| 799 } | 798 } |
| 800 SkColor icon_color = color_utils::DeriveDefaultIconColor(fg_color); | 799 SkColor icon_color = color_utils::DeriveDefaultIconColor(fg_color); |
| 801 | 800 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 } else { | 1076 } else { |
| 1078 const Type& type = menu_item->GetType(); | 1077 const Type& type = menu_item->GetType(); |
| 1079 if (type == CHECKBOX || type == RADIO) | 1078 if (type == CHECKBOX || type == RADIO) |
| 1080 return true; | 1079 return true; |
| 1081 } | 1080 } |
| 1082 } | 1081 } |
| 1083 return false; | 1082 return false; |
| 1084 } | 1083 } |
| 1085 | 1084 |
| 1086 } // namespace views | 1085 } // namespace views |
| OLD | NEW |