OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/menu/menu_item_view.h" | 5 #include "views/controls/menu/menu_item_view.h" |
6 | 6 |
7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "grit/ui_strings.h" | 10 #include "grit/ui_strings.h" |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 // instead. | 682 // instead. |
683 return gfx::Size(width, 0); | 683 return gfx::Size(width, 0); |
684 } | 684 } |
685 | 685 |
686 string16 MenuItemView::GetAcceleratorText() { | 686 string16 MenuItemView::GetAcceleratorText() { |
687 if (id() == kEmptyMenuItemViewID) { | 687 if (id() == kEmptyMenuItemViewID) { |
688 // Don't query the delegate for menus that represent no children. | 688 // Don't query the delegate for menus that represent no children. |
689 return string16(); | 689 return string16(); |
690 } | 690 } |
691 | 691 |
| 692 if(!MenuConfig::instance().show_accelerators) |
| 693 return string16(); |
| 694 |
692 Accelerator accelerator; | 695 Accelerator accelerator; |
693 return (GetDelegate() && | 696 return (GetDelegate() && |
694 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ? | 697 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ? |
695 accelerator.GetShortcutText() : string16(); | 698 accelerator.GetShortcutText() : string16(); |
696 } | 699 } |
697 | 700 |
698 } // namespace views | 701 } // namespace views |
OLD | NEW |