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

Side by Side Diff: views/controls/menu/menu_item_view.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month 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 | « views/controls/menu/menu_delegate.cc ('k') | views/controls/menu/menu_model_adapter.h » ('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 (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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 764
765 string16 MenuItemView::GetAcceleratorText() { 765 string16 MenuItemView::GetAcceleratorText() {
766 if (id() == kEmptyMenuItemViewID) { 766 if (id() == kEmptyMenuItemViewID) {
767 // Don't query the delegate for menus that represent no children. 767 // Don't query the delegate for menus that represent no children.
768 return string16(); 768 return string16();
769 } 769 }
770 770
771 if(!MenuConfig::instance().show_accelerators) 771 if(!MenuConfig::instance().show_accelerators)
772 return string16(); 772 return string16();
773 773
774 Accelerator accelerator; 774 ui::Accelerator accelerator;
775 return (GetDelegate() && 775 return (GetDelegate() &&
776 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ? 776 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ?
777 accelerator.GetShortcutText() : string16(); 777 accelerator.GetShortcutText() : string16();
778 } 778 }
779 779
780 bool MenuItemView::IsContainer() const { 780 bool MenuItemView::IsContainer() const {
781 // Let the first child take over |this| when we only have one child and no 781 // Let the first child take over |this| when we only have one child and no
782 // title. Note that what child_count() returns is the number of children, 782 // title. Note that what child_count() returns is the number of children,
783 // not the number of menu items. 783 // not the number of menu items.
784 return child_count() == 1 && title_.empty(); 784 return child_count() == 1 && title_.empty();
785 } 785 }
786 786
787 } // namespace views 787 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_delegate.cc ('k') | views/controls/menu/menu_model_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698