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

Unified Diff: chrome/browser/gtk/bookmark_context_menu.h

Issue 211056: GTK: Dismiss the bookmark folder menu(s) when a context menu item is executed... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/gtk/bookmark_context_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/bookmark_context_menu.h
===================================================================
--- chrome/browser/gtk/bookmark_context_menu.h (revision 26846)
+++ chrome/browser/gtk/bookmark_context_menu.h (working copy)
@@ -50,6 +50,12 @@
BOOKMARK_MANAGER_ORGANIZE_MENU_OTHER
};
+ class Delegate {
+ public:
+ // Called when one of the menu items is selected and executed.
+ virtual void WillExecuteCommand() = 0;
+ };
+
// Creates the bookmark context menu.
// |profile| is used for opening urls as well as enabling 'open incognito'.
// |browser| is used to determine the PageNavigator and may be null.
@@ -63,7 +69,8 @@
PageNavigator* navigator,
const BookmarkNode* parent,
const std::vector<const BookmarkNode*>& selection,
- ConfigurationType configuration);
+ ConfigurationType configuration,
+ Delegate* delegate);
virtual ~BookmarkContextMenu();
#if defined(TOOLKIT_VIEWS)
@@ -80,6 +87,9 @@
GtkWidget* menu() const { return menu_->widget(); }
#endif
+ // Should be called by the delegate when it is no longer valid.
+ void DelegateDestroyed();
+
// Menu::Delegate / MenuGtk::Delegate methods.
virtual void ExecuteCommand(int id);
virtual bool IsItemChecked(int id) const;
@@ -143,6 +153,7 @@
std::vector<const BookmarkNode*> selection_;
BookmarkModel* model_;
ConfigurationType configuration_;
+ Delegate* delegate_;
#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
scoped_ptr<views::MenuItemView> menu_;
« no previous file with comments | « no previous file | chrome/browser/gtk/bookmark_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698