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_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ExtensionContextMenuModel(const Extension* extension, | 74 ExtensionContextMenuModel(const Extension* extension, |
75 Browser* browser, | 75 Browser* browser, |
76 ButtonVisibility visibility, | 76 ButtonVisibility visibility, |
77 PopupDelegate* delegate); | 77 PopupDelegate* delegate); |
78 ~ExtensionContextMenuModel() override; | 78 ~ExtensionContextMenuModel() override; |
79 | 79 |
80 // SimpleMenuModel::Delegate: | 80 // SimpleMenuModel::Delegate: |
81 bool IsCommandIdChecked(int command_id) const override; | 81 bool IsCommandIdChecked(int command_id) const override; |
82 bool IsCommandIdEnabled(int command_id) const override; | 82 bool IsCommandIdEnabled(int command_id) const override; |
83 bool GetAcceleratorForCommandId(int command_id, | 83 bool GetAcceleratorForCommandId(int command_id, |
84 ui::Accelerator* accelerator) override; | 84 ui::Accelerator* accelerator) const override; |
85 void ExecuteCommand(int command_id, int event_flags) override; | 85 void ExecuteCommand(int command_id, int event_flags) override; |
86 | 86 |
87 ui::SimpleMenuModel* page_access_submenu_for_testing() { | 87 ui::SimpleMenuModel* page_access_submenu_for_testing() { |
88 return page_access_submenu_.get(); | 88 return page_access_submenu_.get(); |
89 } | 89 } |
90 | 90 |
91 private: | 91 private: |
92 void InitMenu(const Extension* extension, ButtonVisibility button_visibility); | 92 void InitMenu(const Extension* extension, ButtonVisibility button_visibility); |
93 | 93 |
94 void CreatePageAccessSubmenu(const Extension* extension); | 94 void CreatePageAccessSubmenu(const Extension* extension); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 std::unique_ptr<ContextMenuMatcher> extension_items_; | 136 std::unique_ptr<ContextMenuMatcher> extension_items_; |
137 | 137 |
138 std::unique_ptr<ui::SimpleMenuModel> page_access_submenu_; | 138 std::unique_ptr<ui::SimpleMenuModel> page_access_submenu_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); | 140 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace extensions | 143 } // namespace extensions |
144 | 144 |
145 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 145 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
OLD | NEW |