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

Side by Side 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: Cleanup Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "grit/ui_resources.h"
6 #include "ui/base/resource/resource_bundle.h"
7 #include "ui/gfx/image/image_skia.h"
8 #include "ui/native_theme/native_theme_mac.h"
5 #include "ui/views/controls/menu/menu_config.h" 9 #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.
10 #include "ui/views/controls/menu/menu_image_util.h"
6 11
7 namespace views { 12 namespace views {
8 13
9 void MenuConfig::Init(const ui::NativeTheme* theme) { 14 void MenuConfig::Init(const ui::NativeTheme* theme) {
10 NOTIMPLEMENTED(); 15 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.
16 arrow_to_edge_padding = 20;
17 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
18 arrow_width = rb.GetImageNamed(IDR_MENU_HIERARCHY_ARROW).Width();
19 gfx::ImageSkia check = GetMenuCheckImage(false);
20 check_height = check.height();
21 item_min_height = 29;
22 separator_spacing_height = 7;
23 separator_lower_height = 8;
24 separator_upper_height = 8;
25 label_to_arrow_padding = 20;
26 label_to_minor_text_padding = 20;
27 always_use_icon_to_label_padding = true;
28 align_arrow_and_shortcut = true;
29 offset_context_menus = true;
30 corner_radius = 2;
31 }
32
33 // static
34 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) {
35 CR_DEFINE_STATIC_LOCAL(MenuConfig,
36 mac_instance,
37 (theme ? theme : ui::NativeTheme::instance()));
38 return mac_instance;
11 } 39 }
12 40
13 } // namespace views 41 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698