Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/base/layout.h" | 8 #include "ui/base/layout.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 icon_to_label_padding(8), | 26 icon_to_label_padding(8), |
| 27 gutter_to_label(5), | 27 gutter_to_label(5), |
| 28 check_width(16), | 28 check_width(16), |
| 29 check_height(16), | 29 check_height(16), |
| 30 radio_width(16), | 30 radio_width(16), |
| 31 radio_height(16), | 31 radio_height(16), |
| 32 arrow_height(9), | 32 arrow_height(9), |
| 33 arrow_width(9), | 33 arrow_width(9), |
| 34 gutter_width(0), | 34 gutter_width(0), |
| 35 separator_height(6), | 35 separator_height(6), |
| 36 separator_upper_height(3), | |
| 37 separator_lower_height(4), | |
| 38 separator_spacing_height(3), | |
| 36 render_gutter(false), | 39 render_gutter(false), |
| 37 show_mnemonics(false), | 40 show_mnemonics(false), |
| 38 scroll_arrow_height(3), | 41 scroll_arrow_height(3), |
| 39 label_to_accelerator_padding(10), | 42 label_to_accelerator_padding(10), |
| 40 item_min_height(0), | 43 item_min_height(0), |
| 41 show_accelerators(true), | 44 show_accelerators(true), |
| 42 always_use_icon_to_label_padding(false), | 45 always_use_icon_to_label_padding(false), |
| 43 align_arrow_and_shortcut(false) { | 46 align_arrow_and_shortcut(false) { |
| 44 // Use 40px tall menu items when running in touch optimized mode. | 47 #if defined (OS_WIN) |
|
sky
2012/08/21 19:36:29
Do you even need the ifdef here? We don't use ui::
Mr4D (OOO till 08-26)
2012/08/21 21:34:54
Well - fact wise you are right, but the code itsel
| |
| 48 // For Windows use 40px tall menu items when running in touch optimized mode. | |
| 45 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 49 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
| 46 item_top_margin = item_no_icon_top_margin = 12; | 50 item_top_margin = item_no_icon_top_margin = 12; |
| 47 item_bottom_margin = item_no_icon_bottom_margin = 13; | 51 item_bottom_margin = item_no_icon_bottom_margin = 13; |
| 48 } | 52 } |
| 53 #endif | |
| 49 } | 54 } |
| 50 | 55 |
| 51 MenuConfig::~MenuConfig() {} | 56 MenuConfig::~MenuConfig() {} |
| 52 | 57 |
| 53 void MenuConfig::Reset() { | 58 void MenuConfig::Reset() { |
| 54 delete config_instance; | 59 delete config_instance; |
| 55 config_instance = NULL; | 60 config_instance = NULL; |
| 56 } | 61 } |
| 57 | 62 |
| 58 // static | 63 // static |
| 59 const MenuConfig& MenuConfig::instance() { | 64 const MenuConfig& MenuConfig::instance() { |
| 60 if (!config_instance) | 65 if (!config_instance) |
| 61 config_instance = Create(); | 66 config_instance = Create(); |
| 62 return *config_instance; | 67 return *config_instance; |
| 63 } | 68 } |
| 64 | 69 |
| 70 // static | |
| 71 const bool MenuConfig::IsNewMenu() { | |
| 72 #if defined(USE_AURA) | |
| 73 return true; | |
| 74 #else | |
| 75 return ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; | |
|
sky
2012/08/21 19:36:29
Why do we need this else?
Mr4D (OOO till 08-26)
2012/08/21 21:34:54
Because I was told that for all other operating sy
| |
| 76 #endif | |
| 77 } | |
| 78 | |
| 79 | |
| 65 } // namespace views | 80 } // namespace views |
| OLD | NEW |