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

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

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 | « no previous file | app/menus/button_menu_item_model.cc » ('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) 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 #ifndef APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ 5 #ifndef APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_
6 #define APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ 6 #define APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // If the button at |index| should have its size equalized along with all 77 // If the button at |index| should have its size equalized along with all
78 // other items that have their PartOfGroup bit set. 78 // other items that have their PartOfGroup bit set.
79 bool PartOfGroup(int index) const; 79 bool PartOfGroup(int index) const;
80 80
81 // Called from implementations. 81 // Called from implementations.
82 void ActivatedCommand(int command_id); 82 void ActivatedCommand(int command_id);
83 83
84 // Returns the enabled state of the button at |index|. 84 // Returns the enabled state of the button at |index|.
85 bool IsEnabledAt(int index) const; 85 bool IsEnabledAt(int index) const;
86 86
87 // Returns the enabled state of the command specified by |command_id|.
88 bool IsCommandIdEnabled(int command_id) const;
89
87 const string16& label() const { return item_label_; } 90 const string16& label() const { return item_label_; }
88 91
89 private: 92 private:
90 // The non-clickable label to the left of the buttons. 93 // The non-clickable label to the left of the buttons.
91 string16 item_label_; 94 string16 item_label_;
92 95
93 struct Item; 96 struct Item;
94 std::vector<Item> items_; 97 std::vector<Item> items_;
95 98
96 Delegate* delegate_; 99 Delegate* delegate_;
97 100
98 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); 101 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel);
99 }; 102 };
100 103
101 } // namespace menus 104 } // namespace menus
102 105
103 #endif // APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ 106 #endif // APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | app/menus/button_menu_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698