| 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_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 explicit OpenWithMenuObserver(RenderViewContextMenuProxy* proxy); | 47 explicit OpenWithMenuObserver(RenderViewContextMenuProxy* proxy); |
| 48 ~OpenWithMenuObserver() override; | 48 ~OpenWithMenuObserver() override; |
| 49 | 49 |
| 50 // RenderViewContextMenuObserver overrides: | 50 // RenderViewContextMenuObserver overrides: |
| 51 void InitMenu(const content::ContextMenuParams& params) override; | 51 void InitMenu(const content::ContextMenuParams& params) override; |
| 52 bool IsCommandIdSupported(int command_id) override; | 52 bool IsCommandIdSupported(int command_id) override; |
| 53 bool IsCommandIdChecked(int command_id) override; | 53 bool IsCommandIdChecked(int command_id) override; |
| 54 bool IsCommandIdEnabled(int command_id) override; | 54 bool IsCommandIdEnabled(int command_id) override; |
| 55 void ExecuteCommand(int command_id) override; | 55 void ExecuteCommand(int command_id) override; |
| 56 void OnMenuCancel() override {} | |
| 57 | 56 |
| 58 // ash::OpenWithItems::Delegate overrides: | 57 // ash::OpenWithItems::Delegate overrides: |
| 59 void ModelChanged(const std::vector<ash::LinkHandlerInfo>& handlers) override; | 58 void ModelChanged(const std::vector<ash::LinkHandlerInfo>& handlers) override; |
| 60 | 59 |
| 61 static void AddPlaceholderItemsForTesting(RenderViewContextMenuProxy* proxy, | 60 static void AddPlaceholderItemsForTesting(RenderViewContextMenuProxy* proxy, |
| 62 ui::SimpleMenuModel* submenu); | 61 ui::SimpleMenuModel* submenu); |
| 63 static std::pair<HandlerMap, int> BuildHandlersMapForTesting( | 62 static std::pair<HandlerMap, int> BuildHandlersMapForTesting( |
| 64 const std::vector<ash::LinkHandlerInfo>& handlers); | 63 const std::vector<ash::LinkHandlerInfo>& handlers); |
| 65 | 64 |
| 66 private: | 65 private: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 86 // A menu model received from Ash side. | 85 // A menu model received from Ash side. |
| 87 std::unique_ptr<ash::LinkHandlerModel> menu_model_; | 86 std::unique_ptr<ash::LinkHandlerModel> menu_model_; |
| 88 OpenWithMenuObserver::HandlerMap handlers_; | 87 OpenWithMenuObserver::HandlerMap handlers_; |
| 89 // A submenu passed to Chrome side. | 88 // A submenu passed to Chrome side. |
| 90 std::unique_ptr<ui::MenuModel> submenu_; | 89 std::unique_ptr<ui::MenuModel> submenu_; |
| 91 | 90 |
| 92 DISALLOW_COPY_AND_ASSIGN(OpenWithMenuObserver); | 91 DISALLOW_COPY_AND_ASSIGN(OpenWithMenuObserver); |
| 93 }; | 92 }; |
| 94 | 93 |
| 95 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ | 94 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_FACTORY_ASH_H_ |
| OLD | NEW |