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

Side by Side Diff: ui/views/controls/menu/menu_delegate.h

Issue 423833002: Check if the delegate changed the visibility of child MenuItemViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added MenuModelAdapter::IsCommandVisible Created 6 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
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 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // screen coordinates. 114 // screen coordinates.
115 // Returns true if a context menu was displayed, otherwise false 115 // Returns true if a context menu was displayed, otherwise false
116 virtual bool ShowContextMenu(MenuItemView* source, 116 virtual bool ShowContextMenu(MenuItemView* source,
117 int id, 117 int id,
118 const gfx::Point& p, 118 const gfx::Point& p,
119 ui::MenuSourceType source_type); 119 ui::MenuSourceType source_type);
120 120
121 // Controller 121 // Controller
122 virtual bool SupportsCommand(int id) const; 122 virtual bool SupportsCommand(int id) const;
123 virtual bool IsCommandEnabled(int id) const; 123 virtual bool IsCommandEnabled(int id) const;
124 virtual bool IsCommandVisible(int id) const;
124 virtual bool GetContextualLabel(int id, base::string16* out) const; 125 virtual bool GetContextualLabel(int id, base::string16* out) const;
125 virtual void ExecuteCommand(int id) { 126 virtual void ExecuteCommand(int id) {
126 } 127 }
127 128
128 // If nested menus are showing (nested menus occur when a menu shows a context 129 // If nested menus are showing (nested menus occur when a menu shows a context
129 // menu) this is invoked to determine if all the menus should be closed when 130 // menu) this is invoked to determine if all the menus should be closed when
130 // the user selects the menu with the command |id|. This returns true to 131 // the user selects the menu with the command |id|. This returns true to
131 // indicate that all menus should be closed. Return false if only the 132 // indicate that all menus should be closed. Return false if only the
132 // context menu should be closed. 133 // context menu should be closed.
133 virtual bool ShouldCloseAllMenusOnExecute(int id); 134 virtual bool ShouldCloseAllMenusOnExecute(int id);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 int* left_margin, 247 int* left_margin,
247 int* right_margin) const; 248 int* right_margin) const;
248 // Returns true if the labels should reserve additional spacing for e.g. 249 // Returns true if the labels should reserve additional spacing for e.g.
249 // submenu indicators at the end of the line. 250 // submenu indicators at the end of the line.
250 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; 251 virtual bool ShouldReserveSpaceForSubmenuIndicator() const;
251 }; 252 };
252 253
253 } // namespace views 254 } // namespace views
254 255
255 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ 256 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc ('k') | ui/views/controls/menu/menu_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698