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

Side by Side Diff: ui/views/controls/menu/menu_config_mac.mm

Issue 1477253002: Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add menu_config_android Created 5 years 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
« no previous file with comments | « ui/views/controls/menu/menu_config_linux.cc ('k') | ui/views/controls/menu/menu_config_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/menu/menu_config.h" 5 #include "ui/views/controls/menu/menu_config.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "ui/gfx/image/image_skia.h"
10 #include "ui/native_theme/native_theme_mac.h"
11 #include "ui/views/controls/menu/menu_image_util.h"
12
13 namespace views { 9 namespace views {
14 10
15 void MenuConfig::Init(const ui::NativeTheme* theme) { 11 void MenuConfig::Init() {
16 DCHECK_EQ(theme, ui::NativeThemeMac::instance());
17 font_list = gfx::FontList(gfx::Font([NSFont menuFontOfSize:0.0])); 12 font_list = gfx::FontList(gfx::Font([NSFont menuFontOfSize:0.0]));
18 menu_vertical_border_size = 4; 13 menu_vertical_border_size = 4;
19 item_top_margin = item_no_icon_top_margin = 1; 14 item_top_margin = item_no_icon_top_margin = 1;
20 item_bottom_margin = item_no_icon_bottom_margin = 1; 15 item_bottom_margin = item_no_icon_bottom_margin = 1;
21 item_left_margin = 2; 16 item_left_margin = 2;
22 arrow_to_edge_padding = 12; 17 arrow_to_edge_padding = 12;
23 icon_to_label_padding = 4; 18 icon_to_label_padding = 4;
24 check_width = 19; 19 check_width = 19;
25 check_height = 11; 20 check_height = 11;
26 separator_height = 13; 21 separator_height = 13;
27 separator_upper_height = 7; 22 separator_upper_height = 7;
28 separator_lower_height = 6; 23 separator_lower_height = 6;
29 align_arrow_and_shortcut = true; 24 align_arrow_and_shortcut = true;
30 icons_in_label = true; 25 icons_in_label = true;
31 check_selected_combobox_item = true; 26 check_selected_combobox_item = true;
32 corner_radius = 5; 27 corner_radius = 5;
33 use_outer_border = false; 28 use_outer_border = false;
34 } 29 }
35 30
36 // static
37 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) {
38 CR_DEFINE_STATIC_LOCAL(MenuConfig, mac_instance, (theme));
39 return mac_instance;
40 }
41
42 } // namespace views 31 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_config_linux.cc ('k') | ui/views/controls/menu/menu_config_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698