| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h" | 10 #include "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Sets the PageNavigator. | 61 // Sets the PageNavigator. |
| 62 void SetPageNavigator(content::PageNavigator* navigator); | 62 void SetPageNavigator(content::PageNavigator* navigator); |
| 63 | 63 |
| 64 // Overridden from views::MenuDelegate: | 64 // Overridden from views::MenuDelegate: |
| 65 void ExecuteCommand(int command_id, int event_flags) override; | 65 void ExecuteCommand(int command_id, int event_flags) override; |
| 66 bool IsItemChecked(int command_id) const override; | 66 bool IsItemChecked(int command_id) const override; |
| 67 bool IsCommandEnabled(int command_id) const override; | 67 bool IsCommandEnabled(int command_id) const override; |
| 68 bool IsCommandVisible(int command_id) const override; | 68 bool IsCommandVisible(int command_id) const override; |
| 69 bool ShouldCloseAllMenusOnExecute(int id) override; | 69 bool ShouldCloseAllMenusOnExecute(int id) override; |
| 70 void OnMenuClosed(views::MenuItemView* menu, | 70 void OnMenuClosed(views::MenuItemView* menu) override; |
| 71 views::MenuRunner::RunResult result) override; | |
| 72 | 71 |
| 73 // Overridden from BookmarkContextMenuControllerDelegate: | 72 // Overridden from BookmarkContextMenuControllerDelegate: |
| 74 void CloseMenu() override; | 73 void CloseMenu() override; |
| 75 void WillExecuteCommand( | 74 void WillExecuteCommand( |
| 76 int command_id, | 75 int command_id, |
| 77 const std::vector<const bookmarks::BookmarkNode*>& bookmarks) override; | 76 const std::vector<const bookmarks::BookmarkNode*>& bookmarks) override; |
| 78 void DidExecuteCommand(int command_id) override; | 77 void DidExecuteCommand(int command_id) override; |
| 79 | 78 |
| 80 private: | 79 private: |
| 81 std::unique_ptr<BookmarkContextMenuController> controller_; | 80 std::unique_ptr<BookmarkContextMenuController> controller_; |
| 82 | 81 |
| 83 // The parent of dialog boxes opened from the context menu. | 82 // The parent of dialog boxes opened from the context menu. |
| 84 views::Widget* parent_widget_; | 83 views::Widget* parent_widget_; |
| 85 | 84 |
| 86 // The menu itself. This is owned by |menu_runner_|. | 85 // The menu itself. This is owned by |menu_runner_|. |
| 87 views::MenuItemView* menu_; | 86 views::MenuItemView* menu_; |
| 88 | 87 |
| 89 // Responsible for running the menu. | 88 // Responsible for running the menu. |
| 90 std::unique_ptr<views::MenuRunner> menu_runner_; | 89 std::unique_ptr<views::MenuRunner> menu_runner_; |
| 91 | 90 |
| 92 BookmarkContextMenuObserver* observer_; | 91 BookmarkContextMenuObserver* observer_; |
| 93 | 92 |
| 94 // Should the menu close when a node is removed. | 93 // Should the menu close when a node is removed. |
| 95 bool close_on_remove_; | 94 bool close_on_remove_; |
| 96 | 95 |
| 97 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); | 96 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); |
| 98 }; | 97 }; |
| 99 | 98 |
| 100 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 99 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| OLD | NEW |