| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // ShowPopupForDevToolsWindow() to be called on |delegate|. | 73 // ShowPopupForDevToolsWindow() to be called on |delegate|. |
| 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, | |
| 84 ui::Accelerator* accelerator) const override; | |
| 85 void ExecuteCommand(int command_id, int event_flags) override; | 83 void ExecuteCommand(int command_id, int event_flags) override; |
| 86 | 84 |
| 87 ui::SimpleMenuModel* page_access_submenu_for_testing() { | 85 ui::SimpleMenuModel* page_access_submenu_for_testing() { |
| 88 return page_access_submenu_.get(); | 86 return page_access_submenu_.get(); |
| 89 } | 87 } |
| 90 | 88 |
| 91 private: | 89 private: |
| 92 void InitMenu(const Extension* extension, ButtonVisibility button_visibility); | 90 void InitMenu(const Extension* extension, ButtonVisibility button_visibility); |
| 93 | 91 |
| 94 void CreatePageAccessSubmenu(const Extension* extension); | 92 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_; | 134 std::unique_ptr<ContextMenuMatcher> extension_items_; |
| 137 | 135 |
| 138 std::unique_ptr<ui::SimpleMenuModel> page_access_submenu_; | 136 std::unique_ptr<ui::SimpleMenuModel> page_access_submenu_; |
| 139 | 137 |
| 140 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); | 138 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); |
| 141 }; | 139 }; |
| 142 | 140 |
| 143 } // namespace extensions | 141 } // namespace extensions |
| 144 | 142 |
| 145 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
| OLD | NEW |