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

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

Issue 267593005: Refactor menu controller to isolate aura dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing ifdefs, work in progress Created 6 years, 8 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
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..84ba6ea20710f56681546ac5cefb720f5fcfa466 100644
--- a/ui/views/controls/menu/menu_config_mac.cc
+++ b/ui/views/controls/menu/menu_config_mac.cc
@@ -2,12 +2,41 @@
// 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"
+#include "ui/views/controls/menu/menu_image_util.h"
namespace views {
void MenuConfig::Init(const ui::NativeTheme* theme) {
- NOTIMPLEMENTED();
+ submenu_horizontal_inset = 1;
+ 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) {
+ static MenuConfig* views_instance = NULL;
tapted 2014/05/04 23:43:39 This should probably be CR_DEFINE_STATIC_LOCAL
Andre 2014/05/05 22:41:29 Done.
+ if (!views_instance)
+ views_instance = new MenuConfig(theme ?
+ theme : ui::NativeTheme::instance());
+ return *views_instance;
}
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698