Index: ui/views/controls/menu/menu_config_mac.cc |
diff --git a/ui/views/controls/menu/menu_config_mac.cc b/ui/views/controls/menu/menu_config_mac.cc |
index fdd7de9da297ce9db37d60baa32e35a3bc0f50a7..440c7f7df2ae1e0eae008c76e9e9dcc7597d1199 100644 |
--- a/ui/views/controls/menu/menu_config_mac.cc |
+++ b/ui/views/controls/menu/menu_config_mac.cc |
@@ -2,12 +2,40 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "grit/ui_resources.h" |
+#include "ui/base/resource/resource_bundle.h" |
+#include "ui/gfx/image/image_skia.h" |
+#include "ui/native_theme/native_theme_mac.h" |
#include "ui/views/controls/menu/menu_config.h" |
tapted
2014/05/06 00:02:46
nit: i'd probably put this as first include with a
Andre
2014/05/07 23:12:39
Done.
|
+#include "ui/views/controls/menu/menu_image_util.h" |
namespace views { |
void MenuConfig::Init(const ui::NativeTheme* theme) { |
- NOTIMPLEMENTED(); |
+ submenu_horizontal_inset = 1; |
tapted
2014/05/06 00:02:46
Maybe add a TODO - "tune these parameters for Mac"
Andre
2014/05/07 23:12:39
Done.
|
+ arrow_to_edge_padding = 20; |
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
+ arrow_width = rb.GetImageNamed(IDR_MENU_HIERARCHY_ARROW).Width(); |
+ gfx::ImageSkia check = GetMenuCheckImage(false); |
+ check_height = check.height(); |
+ item_min_height = 29; |
+ separator_spacing_height = 7; |
+ separator_lower_height = 8; |
+ separator_upper_height = 8; |
+ label_to_arrow_padding = 20; |
+ label_to_minor_text_padding = 20; |
+ always_use_icon_to_label_padding = true; |
+ align_arrow_and_shortcut = true; |
+ offset_context_menus = true; |
+ corner_radius = 2; |
+} |
+ |
+// static |
+const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) { |
+ CR_DEFINE_STATIC_LOCAL(MenuConfig, |
+ mac_instance, |
+ (theme ? theme : ui::NativeTheme::instance())); |
+ return mac_instance; |
} |
} // namespace views |