OLD | NEW |
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 CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const bookmarks::BookmarkNode* parent, | 60 const bookmarks::BookmarkNode* parent, |
61 const std::vector<const bookmarks::BookmarkNode*>& selection); | 61 const std::vector<const bookmarks::BookmarkNode*>& selection); |
62 ~BookmarkContextMenuController() override; | 62 ~BookmarkContextMenuController() override; |
63 | 63 |
64 ui::SimpleMenuModel* menu_model() { return menu_model_.get(); } | 64 ui::SimpleMenuModel* menu_model() { return menu_model_.get(); } |
65 | 65 |
66 // ui::SimpleMenuModel::Delegate implementation: | 66 // ui::SimpleMenuModel::Delegate implementation: |
67 bool IsCommandIdChecked(int command_id) const override; | 67 bool IsCommandIdChecked(int command_id) const override; |
68 bool IsCommandIdEnabled(int command_id) const override; | 68 bool IsCommandIdEnabled(int command_id) const override; |
69 bool IsCommandIdVisible(int command_id) const override; | 69 bool IsCommandIdVisible(int command_id) const override; |
70 bool GetAcceleratorForCommandId(int command_id, | |
71 ui::Accelerator* accelerator) const override; | |
72 void ExecuteCommand(int command_id, int event_flags) override; | 70 void ExecuteCommand(int command_id, int event_flags) override; |
73 bool IsItemForCommandIdDynamic(int command_id) const override; | 71 bool IsItemForCommandIdDynamic(int command_id) const override; |
74 base::string16 GetLabelForCommandId(int command_id) const override; | 72 base::string16 GetLabelForCommandId(int command_id) const override; |
75 | 73 |
76 void set_navigator(content::PageNavigator* navigator) { | 74 void set_navigator(content::PageNavigator* navigator) { |
77 navigator_ = navigator; | 75 navigator_ = navigator; |
78 } | 76 } |
79 | 77 |
80 private: | 78 private: |
81 void BuildMenu(); | 79 void BuildMenu(); |
(...skipping 18 matching lines...) Expand all Loading... |
100 std::vector<const bookmarks::BookmarkNode*> selection_; | 98 std::vector<const bookmarks::BookmarkNode*> selection_; |
101 bookmarks::BookmarkModel* model_; | 99 bookmarks::BookmarkModel* model_; |
102 std::unique_ptr<ui::SimpleMenuModel> menu_model_; | 100 std::unique_ptr<ui::SimpleMenuModel> menu_model_; |
103 // Used to detect deletion of |this| executing a command. | 101 // Used to detect deletion of |this| executing a command. |
104 base::WeakPtrFactory<BookmarkContextMenuController> weak_factory_; | 102 base::WeakPtrFactory<BookmarkContextMenuController> weak_factory_; |
105 | 103 |
106 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); | 104 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); |
107 }; | 105 }; |
108 | 106 |
109 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ | 107 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ |
OLD | NEW |