| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 11 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 12 #include "extensions/common/constants.h" | 12 #include "extensions/common/constants.h" |
| 13 | 13 |
| 14 class ChromeLauncherControllerImpl; | 14 class ChromeLauncherController; |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 struct ShelfItem; | 17 struct ShelfItem; |
| 18 class WmShelf; | 18 class WmShelf; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 class ContextMenuMatcher; | 22 class ContextMenuMatcher; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Context menu shown for an extension item in the shelf. | 25 // Context menu shown for an extension item in the shelf. |
| 26 class ExtensionLauncherContextMenu : public LauncherContextMenu { | 26 class ExtensionLauncherContextMenu : public LauncherContextMenu { |
| 27 public: | 27 public: |
| 28 ExtensionLauncherContextMenu(ChromeLauncherControllerImpl* controller, | 28 ExtensionLauncherContextMenu(ChromeLauncherController* controller, |
| 29 const ash::ShelfItem* item, | 29 const ash::ShelfItem* item, |
| 30 ash::WmShelf* wm_shelf); | 30 ash::WmShelf* wm_shelf); |
| 31 ~ExtensionLauncherContextMenu() override; | 31 ~ExtensionLauncherContextMenu() override; |
| 32 | 32 |
| 33 // ui::SimpleMenuModel::Delegate overrides: | 33 // ui::SimpleMenuModel::Delegate overrides: |
| 34 bool IsItemForCommandIdDynamic(int command_id) const override; | 34 bool IsItemForCommandIdDynamic(int command_id) const override; |
| 35 base::string16 GetLabelForCommandId(int command_id) const override; | 35 base::string16 GetLabelForCommandId(int command_id) const override; |
| 36 bool IsCommandIdChecked(int command_id) const override; | 36 bool IsCommandIdChecked(int command_id) const override; |
| 37 bool IsCommandIdEnabled(int command_id) const override; | 37 bool IsCommandIdEnabled(int command_id) const override; |
| 38 void ExecuteCommand(int command_id, int event_flags) override; | 38 void ExecuteCommand(int command_id, int event_flags) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 void Init(); | 41 void Init(); |
| 42 | 42 |
| 43 // Helpers to get and set the launch type for the extension item. | 43 // Helpers to get and set the launch type for the extension item. |
| 44 extensions::LaunchType GetLaunchType() const; | 44 extensions::LaunchType GetLaunchType() const; |
| 45 void SetLaunchType(extensions::LaunchType launch_type); | 45 void SetLaunchType(extensions::LaunchType launch_type); |
| 46 | 46 |
| 47 std::unique_ptr<extensions::ContextMenuMatcher> extension_items_; | 47 std::unique_ptr<extensions::ContextMenuMatcher> extension_items_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ExtensionLauncherContextMenu); | 49 DISALLOW_COPY_AND_ASSIGN(ExtensionLauncherContextMenu); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ | 52 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_LAUNCHER_CONTEXT_MENU_H_ |
| OLD | NEW |