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

Side by Side Diff: ui/base/models/simple_menu_model.cc

Issue 2138353002: SimpleMenuModel and ButtonMenuItemModel implement AcceleratorProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@menumodel-accelerator-default
Patch Set: Fix compile on Windows. Created 4 years, 4 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
« no previous file with comments | « ui/base/models/simple_menu_model.h ('k') | no next file » | 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) 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/base/models/simple_menu_model.h" 5 #include "ui/base/models/simple_menu_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 19 matching lines...) Expand all
30 MenuSeparatorType separator_type; 30 MenuSeparatorType separator_type;
31 }; 31 };
32 32
33 //////////////////////////////////////////////////////////////////////////////// 33 ////////////////////////////////////////////////////////////////////////////////
34 // SimpleMenuModel::Delegate, public: 34 // SimpleMenuModel::Delegate, public:
35 35
36 bool SimpleMenuModel::Delegate::IsCommandIdVisible(int command_id) const { 36 bool SimpleMenuModel::Delegate::IsCommandIdVisible(int command_id) const {
37 return true; 37 return true;
38 } 38 }
39 39
40 bool SimpleMenuModel::Delegate::GetAcceleratorForCommandId(
41 int command_id,
42 ui::Accelerator* accelerator) const {
43 return false;
44 }
45
46 bool SimpleMenuModel::Delegate::IsItemForCommandIdDynamic( 40 bool SimpleMenuModel::Delegate::IsItemForCommandIdDynamic(
47 int command_id) const { 41 int command_id) const {
48 return false; 42 return false;
49 } 43 }
50 44
51 base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId( 45 base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
52 int command_id) const { 46 int command_id) const {
53 return base::string16(); 47 return base::string16();
54 } 48 }
55 49
(...skipping 14 matching lines...) Expand all
70 64
71 void SimpleMenuModel::Delegate::CommandIdHighlighted(int command_id) { 65 void SimpleMenuModel::Delegate::CommandIdHighlighted(int command_id) {
72 } 66 }
73 67
74 void SimpleMenuModel::Delegate::MenuWillShow(SimpleMenuModel* /*source*/) { 68 void SimpleMenuModel::Delegate::MenuWillShow(SimpleMenuModel* /*source*/) {
75 } 69 }
76 70
77 void SimpleMenuModel::Delegate::MenuClosed(SimpleMenuModel* /*source*/) { 71 void SimpleMenuModel::Delegate::MenuClosed(SimpleMenuModel* /*source*/) {
78 } 72 }
79 73
74 bool SimpleMenuModel::Delegate::GetAcceleratorForCommandId(
75 int command_id,
76 ui::Accelerator* accelerator) const {
77 return false;
78 }
79
80 //////////////////////////////////////////////////////////////////////////////// 80 ////////////////////////////////////////////////////////////////////////////////
81 // SimpleMenuModel, public: 81 // SimpleMenuModel, public:
82 82
83 SimpleMenuModel::SimpleMenuModel(Delegate* delegate) 83 SimpleMenuModel::SimpleMenuModel(Delegate* delegate)
84 : delegate_(delegate), 84 : delegate_(delegate),
85 menu_model_delegate_(NULL), 85 menu_model_delegate_(NULL),
86 method_factory_(this) { 86 method_factory_(this) {
87 } 87 }
88 88
89 SimpleMenuModel::~SimpleMenuModel() { 89 SimpleMenuModel::~SimpleMenuModel() {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 #ifndef NDEBUG 451 #ifndef NDEBUG
452 if (item.type == TYPE_SEPARATOR) { 452 if (item.type == TYPE_SEPARATOR) {
453 DCHECK_EQ(item.command_id, kSeparatorId); 453 DCHECK_EQ(item.command_id, kSeparatorId);
454 } else { 454 } else {
455 DCHECK_GE(item.command_id, 0); 455 DCHECK_GE(item.command_id, 0);
456 } 456 }
457 #endif // NDEBUG 457 #endif // NDEBUG
458 } 458 }
459 459
460 } // namespace ui 460 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/models/simple_menu_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698