| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APP_LIST_APP_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace app_list { | 21 namespace app_list { |
| 22 | 22 |
| 23 class AppContextMenuDelegate; | 23 class AppContextMenuDelegate; |
| 24 | 24 |
| 25 class AppContextMenu : public ui::SimpleMenuModel::Delegate { | 25 class AppContextMenu : public ui::SimpleMenuModel::Delegate { |
| 26 public: | 26 public: |
| 27 AppContextMenu(AppContextMenuDelegate* delegate, | 27 AppContextMenu(AppContextMenuDelegate* delegate, |
| 28 Profile* profile, | 28 Profile* profile, |
| 29 const std::string& app_id, | 29 const std::string& app_id, |
| 30 AppListControllerDelegate* controller); | 30 AppListControllerDelegate* controller); |
| 31 virtual ~AppContextMenu(); | 31 ~AppContextMenu() override; |
| 32 | 32 |
| 33 // Note this could return NULL if corresponding extension is gone. | 33 // Note this could return NULL if corresponding extension is gone. |
| 34 ui::MenuModel* GetMenuModel(); | 34 ui::MenuModel* GetMenuModel(); |
| 35 | 35 |
| 36 void set_is_platform_app(bool is_platform_app) { | 36 void set_is_platform_app(bool is_platform_app) { |
| 37 is_platform_app_ = is_platform_app; | 37 is_platform_app_ = is_platform_app; |
| 38 } | 38 } |
| 39 void set_is_search_result(bool is_search_result) { | 39 void set_is_search_result(bool is_search_result) { |
| 40 is_search_result_ = is_search_result; | 40 is_search_result_ = is_search_result; |
| 41 } | 41 } |
| 42 void set_is_in_folder(bool is_in_folder) { | 42 void set_is_in_folder(bool is_in_folder) { |
| 43 is_in_folder_ = is_in_folder; | 43 is_in_folder_ = is_in_folder; |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // ui::SimpleMenuModel::Delegate overrides: | 47 // ui::SimpleMenuModel::Delegate overrides: |
| 48 virtual bool IsItemForCommandIdDynamic(int command_id) const override; | 48 bool IsItemForCommandIdDynamic(int command_id) const override; |
| 49 virtual base::string16 GetLabelForCommandId(int command_id) const override; | 49 base::string16 GetLabelForCommandId(int command_id) const override; |
| 50 virtual bool IsCommandIdChecked(int command_id) const override; | 50 bool IsCommandIdChecked(int command_id) const override; |
| 51 virtual bool IsCommandIdEnabled(int command_id) const override; | 51 bool IsCommandIdEnabled(int command_id) const override; |
| 52 virtual bool GetAcceleratorForCommandId( | 52 bool GetAcceleratorForCommandId(int command_id, |
| 53 int command_id, | 53 ui::Accelerator* acclelrator) override; |
| 54 ui::Accelerator* acclelrator) override; | 54 void ExecuteCommand(int command_id, int event_flags) override; |
| 55 virtual void ExecuteCommand(int command_id, int event_flags) override; | |
| 56 | 55 |
| 57 AppContextMenuDelegate* delegate_; | 56 AppContextMenuDelegate* delegate_; |
| 58 Profile* profile_; | 57 Profile* profile_; |
| 59 const std::string app_id_; | 58 const std::string app_id_; |
| 60 AppListControllerDelegate* controller_; | 59 AppListControllerDelegate* controller_; |
| 61 bool is_platform_app_; | 60 bool is_platform_app_; |
| 62 bool is_search_result_; | 61 bool is_search_result_; |
| 63 bool is_in_folder_; | 62 bool is_in_folder_; |
| 64 | 63 |
| 65 scoped_ptr<ui::SimpleMenuModel> menu_model_; | 64 scoped_ptr<ui::SimpleMenuModel> menu_model_; |
| 66 scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_; | 65 scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_; |
| 67 | 66 |
| 68 DISALLOW_COPY_AND_ASSIGN(AppContextMenu); | 67 DISALLOW_COPY_AND_ASSIGN(AppContextMenu); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace app_list | 70 } // namespace app_list |
| 72 | 71 |
| 73 #endif // CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_ | 72 #endif // CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_ |
| OLD | NEW |