diff options
author | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 23:05:24 +0000 |
---|---|---|
committer | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 23:05:24 +0000 |
commit | 037e90255113a0ab758c54a66772ddfc0ff33397 (patch) | |
tree | 97c042f6790958690425d2e69e517b37832070e6 /ui | |
parent | 2b2dfe2451007312b1a23753e9854d557201fa33 (diff) | |
download | chromium_src-037e90255113a0ab758c54a66772ddfc0ff33397.zip chromium_src-037e90255113a0ab758c54a66772ddfc0ff33397.tar.gz chromium_src-037e90255113a0ab758c54a66772ddfc0ff33397.tar.bz2 |
Removed menu finch experiments and applied sizes from MENU_VARIATION_COMPACT_2 and colors from MENU_VARIATION_CONTRAST
BUG=267620, 266696
Review URL: https://chromiumcodereview.appspot.com/23447024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/native_theme/common_theme.cc | 22 | ||||
-rw-r--r-- | ui/native_theme/common_theme.h | 7 | ||||
-rw-r--r-- | ui/native_theme/native_theme.cc | 24 | ||||
-rw-r--r-- | ui/native_theme/native_theme.h | 9 | ||||
-rw-r--r-- | ui/views/controls/menu/menu_config.cc | 37 | ||||
-rw-r--r-- | ui/views/controls/menu/menu_config.h | 3 |
6 files changed, 8 insertions, 94 deletions
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc index b589c00..8c5a964 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc @@ -21,8 +21,7 @@ namespace { // MenuItem: const SkColor kMenuBackgroundColor = SK_ColorWHITE; -const SkColor kMenuHighlightBackgroundColor = SkColorSetARGB(15, 0, 0, 0); -const SkColor kMenuHighlightBackgroundColor2 = SkColorSetRGB(0x42, 0x81, 0xF4); +const SkColor kMenuHighlightBackgroundColor = SkColorSetRGB(0x42, 0x81, 0xF4); const SkColor kMenuInvertedSchemeHighlightBackgroundColor = SkColorSetRGB(48, 48, 48); const SkColor kMenuBorderColor = SkColorSetRGB(0xBA, 0xBA, 0xBA); @@ -73,7 +72,7 @@ bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { *color = kDisabledMenuItemForegroundColor; break; case NativeTheme::kColorId_SelectedMenuItemForegroundColor: - *color = kEnabledMenuItemForegroundColor; + *color = SK_ColorWHITE; break; case NativeTheme::kColorId_ButtonDisabledColor: *color = kDisabledMenuItemForegroundColor; @@ -82,8 +81,6 @@ bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { return false; } - *color = AdjustColorForMenuVariations(color_id, *color); - if (gfx::IsInvertedColorScheme()) { switch (color_id) { case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: @@ -168,19 +165,4 @@ void CommonThemePaintMenuItemBackground(SkCanvas* canvas, canvas->drawRect(gfx::RectToSkRect(rect), paint); } -SkColor AdjustColorForMenuVariations(NativeTheme::ColorId color_id, - SkColor color) { - if (NativeTheme::GetMenuVariation() != NativeTheme::MENU_VARIATION_CONTRAST) - return color; - - switch(color_id) { - case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: - return kMenuHighlightBackgroundColor2; - case NativeTheme::kColorId_SelectedMenuItemForegroundColor: - return SK_ColorWHITE; - default: - return color; - } -} - } // namespace ui diff --git a/ui/native_theme/common_theme.h b/ui/native_theme/common_theme.h index 530032f..c91f489 100644 --- a/ui/native_theme/common_theme.h +++ b/ui/native_theme/common_theme.h @@ -39,13 +39,6 @@ void NATIVE_THEME_EXPORT CommonThemePaintMenuItemBackground( NativeTheme::State state, const gfx::Rect& rect); -// Adjust some colors for menu Finch experiments. -// |color_id| id of a color to be adjusted. -// |color| color before adjustment. -// Returns adjusted color. -SkColor AdjustColorForMenuVariations(NativeTheme::ColorId color_id, - SkColor color); - } // namespace ui #endif // UI_NATIVE_THEME_COMMON_THEME_H_ diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc index af44a7f..8cb845c 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc @@ -4,16 +4,6 @@ #include "ui/native_theme/native_theme.h" -#include "base/command_line.h" -#include "base/metrics/field_trial.h" - - -// Constants for the new menu style field trial. -const char kMenuVariationFieldTrialName[] = "NewMenuStyle"; -const char kMenuVariationFieldTrialGroupNameCompact1[] = "Compact1"; -const char kMenuVariationFieldTrialGroupNameCompact2[] = "Compact2"; -const char kMenuVariationFieldTrialGroupNameHigherContrast[] = "HigherContrast"; - namespace ui { void NativeTheme::SetScrollbarColors(unsigned inactive_color, @@ -27,20 +17,6 @@ void NativeTheme::SetScrollbarColors(unsigned inactive_color, // NativeTheme::instance() is implemented in the platform specific source files, // such as native_theme_win.cc or native_theme_linux.cc -// static -NativeTheme::MenuVariation NativeTheme::GetMenuVariation() { - std::string trial_group_name = - base::FieldTrialList::FindFullName(kMenuVariationFieldTrialName); - if (trial_group_name == kMenuVariationFieldTrialGroupNameCompact1) - return MENU_VARIATION_COMPACT_1; - if (trial_group_name == kMenuVariationFieldTrialGroupNameCompact2) - return MENU_VARIATION_COMPACT_2; - if (trial_group_name == kMenuVariationFieldTrialGroupNameHigherContrast) - return MENU_VARIATION_CONTRAST; - - return MENU_VARIATION_NORMAL; -} - NativeTheme::NativeTheme() : thumb_inactive_color_(0xeaeaea), thumb_active_color_(0xf4f4f4), diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h index 3037916..9897414 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h @@ -85,13 +85,6 @@ class NATIVE_THEME_EXPORT NativeTheme { kMaxState, }; - enum MenuVariation { - MENU_VARIATION_NORMAL, - MENU_VARIATION_COMPACT_1, - MENU_VARIATION_COMPACT_2, - MENU_VARIATION_CONTRAST - }; - // Each structure below holds extra information needed when painting a given // part. @@ -296,8 +289,6 @@ class NATIVE_THEME_EXPORT NativeTheme { // function, returning the port's subclass. static NativeTheme* instance(); - static MenuVariation GetMenuVariation(); - protected: NativeTheme(); virtual ~NativeTheme(); diff --git a/ui/views/controls/menu/menu_config.cc b/ui/views/controls/menu/menu_config.cc index 1657085..1c34ac0 100644 --- a/ui/views/controls/menu/menu_config.cc +++ b/ui/views/controls/menu/menu_config.cc @@ -13,13 +13,13 @@ namespace views { MenuConfig::MenuConfig(const ui::NativeTheme* theme) : text_color(SK_ColorBLACK), arrow_color(SK_ColorBLACK), - menu_vertical_border_size(7), + menu_vertical_border_size(3), menu_horizontal_border_size(0), submenu_horizontal_inset(3), - item_top_margin(7), - item_bottom_margin(6), - item_no_icon_top_margin(7), - item_no_icon_bottom_margin(7), + item_top_margin(4), + item_bottom_margin(3), + item_no_icon_top_margin(4), + item_no_icon_bottom_margin(4), item_left_margin(10), label_to_arrow_padding(10), arrow_to_edge_padding(5), @@ -32,7 +32,7 @@ MenuConfig::MenuConfig(const ui::NativeTheme* theme) arrow_height(9), arrow_width(9), gutter_width(0), - separator_height(15), + separator_height(11), separator_upper_height(3), separator_lower_height(4), separator_spacing_height(3), @@ -48,7 +48,6 @@ MenuConfig::MenuConfig(const ui::NativeTheme* theme) native_theme(theme), show_delay(400), corner_radius(0) { - AdjustForMenuVariations(); // Use 40px tall menu items when running in touch optimized mode. // For Windows use 40px tall menu items when running in touch optimized mode. if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { @@ -60,28 +59,4 @@ MenuConfig::MenuConfig(const ui::NativeTheme* theme) MenuConfig::~MenuConfig() {} -void MenuConfig::AdjustForMenuVariations() { - switch (ui::NativeTheme::GetMenuVariation()) { - case ui::NativeTheme::MENU_VARIATION_COMPACT_1: - case ui::NativeTheme::MENU_VARIATION_CONTRAST: - item_top_margin = 5; - item_bottom_margin = 4; - item_no_icon_top_margin = 5; - item_no_icon_bottom_margin = 5; - separator_height = 11; - menu_vertical_border_size = 5; - break; - case ui::NativeTheme::MENU_VARIATION_COMPACT_2: - item_top_margin = 4; - item_bottom_margin = 3; - item_no_icon_top_margin = 4; - item_no_icon_bottom_margin = 4; - separator_height = 11; - menu_vertical_border_size = 3; - break; - default: - break; - } -} - } // namespace views diff --git a/ui/views/controls/menu/menu_config.h b/ui/views/controls/menu/menu_config.h index ac94782..96eb21a 100644 --- a/ui/views/controls/menu/menu_config.h +++ b/ui/views/controls/menu/menu_config.h @@ -139,9 +139,6 @@ struct VIEWS_EXPORT MenuConfig { #if defined(USE_AURA) void InitAura(const ui::NativeTheme* theme); #endif - - // Adjust some menu values for different menu variations. - void AdjustForMenuVariations(); }; } // namespace views |