Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/wrench_menu.h |
| diff --git a/chrome/browser/ui/views/toolbar/wrench_menu.h b/chrome/browser/ui/views/toolbar/wrench_menu.h |
| index 6108547badca3ffcad92a2c916bf01ea605f92b9..ab07c50bd26ac82e705bba929462486244a68b97 100644 |
| --- a/chrome/browser/ui/views/toolbar/wrench_menu.h |
| +++ b/chrome/browser/ui/views/toolbar/wrench_menu.h |
| @@ -37,10 +37,13 @@ class WrenchMenu : public views::MenuDelegate, |
| public BaseBookmarkModelObserver, |
| public content::NotificationObserver { |
| public: |
| + // |for_drop| indicates whether or not the menu is being opened for a |
| + // drag-and-drop operation. |
| // TODO: remove |use_new_menu| and |supports_new_separators|. |
| WrenchMenu(Browser* browser, |
| bool use_new_menu, |
|
sky
2014/07/18 19:36:54
I think it's time to convert to a bitmask here.
Devlin
2014/07/18 21:38:31
Done.
|
| - bool supports_new_separators); |
| + bool supports_new_separators, |
| + bool for_drop); |
| virtual ~WrenchMenu(); |
| void Init(ui::MenuModel* model); |
| @@ -48,10 +51,14 @@ class WrenchMenu : public views::MenuDelegate, |
| // Shows the menu relative to the specified view. |
| void RunMenu(views::MenuButton* host); |
| + // Closes the menu if it is open, otherwise does nothing. |
| + void CloseMenu(); |
|
sky
2014/07/18 19:36:54
Instead of the close can you just delete this obje
Devlin
2014/07/18 21:38:31
Nope - doing so causes a segfault.
|
| + |
| // Whether the menu is currently visible to the user. |
| bool IsShowing(); |
| bool use_new_menu() const { return use_new_menu_; } |
| + bool for_drop() const { return for_drop_; } |
| void AddObserver(WrenchMenuObserver* observer); |
| void RemoveObserver(WrenchMenuObserver* observer); |
| @@ -94,6 +101,7 @@ class WrenchMenu : public views::MenuDelegate, |
| virtual void WillShowMenu(views::MenuItemView* menu) OVERRIDE; |
| virtual void WillHideMenu(views::MenuItemView* menu) OVERRIDE; |
| virtual bool ShouldCloseOnDragComplete() OVERRIDE; |
| + virtual bool InNestedDrag() OVERRIDE; |
| // BaseBookmarkModelObserver overrides: |
| virtual void BookmarkModelChanged() OVERRIDE; |
| @@ -181,6 +189,9 @@ class WrenchMenu : public views::MenuDelegate, |
| const bool supports_new_separators_; |
| + // Whether or not the menu is opened for a drag and drop operation. |
| + bool for_drop_; |
| + |
| ObserverList<WrenchMenuObserver> observer_list_; |
| DISALLOW_COPY_AND_ASSIGN(WrenchMenu); |