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

Side by Side Diff: app/menus/button_menu_item_model.cc

Issue 3032038: The button menu items on GTK menus honor the enabled state of the command.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « app/menus/button_menu_item_model.h ('k') | chrome/browser/gtk/menu_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/menus/button_menu_item_model.h" 5 #include "app/menus/button_menu_item_model.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 8
9 namespace menus { 9 namespace menus {
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool ButtonMenuItemModel::PartOfGroup(int index) const { 96 bool ButtonMenuItemModel::PartOfGroup(int index) const {
97 return items_[index].part_of_group; 97 return items_[index].part_of_group;
98 } 98 }
99 99
100 void ButtonMenuItemModel::ActivatedCommand(int command_id) { 100 void ButtonMenuItemModel::ActivatedCommand(int command_id) {
101 if (delegate_) 101 if (delegate_)
102 delegate_->ExecuteCommand(command_id); 102 delegate_->ExecuteCommand(command_id);
103 } 103 }
104 104
105 bool ButtonMenuItemModel::IsEnabledAt(int index) const { 105 bool ButtonMenuItemModel::IsEnabledAt(int index) const {
106 return IsCommandIdEnabled(items_[index].command_id);
107 }
108
109 bool ButtonMenuItemModel::IsCommandIdEnabled(int command_id) const {
106 if (delegate_) 110 if (delegate_)
107 return delegate_->IsCommandIdEnabled(items_[index].command_id); 111 return delegate_->IsCommandIdEnabled(command_id);
108 return true; 112 return true;
109 } 113 }
110 114
111 } // namespace menus 115 } // namespace menus
OLDNEW
« no previous file with comments | « app/menus/button_menu_item_model.h ('k') | chrome/browser/gtk/menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698