OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
| 12 #include "components/renderer_context_menu/render_view_context_menu_observer.h" |
| 13 |
| 14 class RenderViewContextMenuProxy; |
| 15 |
| 16 // An observer that listens to events from the RenderViewContextMenu class and |
| 17 // shows app names received from ARC that can handle the current URL. |
| 18 class OpenWithMenuObserver : public RenderViewContextMenuObserver { |
| 19 public: |
| 20 explicit OpenWithMenuObserver(RenderViewContextMenuProxy* proxy); |
| 21 ~OpenWithMenuObserver() override; |
| 22 |
| 23 // RenderViewContextMenuObserver implementation. |
| 24 void InitMenu(const content::ContextMenuParams& params) override; |
| 25 bool IsCommandIdSupported(int command_id) override; |
| 26 bool IsCommandIdChecked(int command_id) override; |
| 27 bool IsCommandIdEnabled(int command_id) override; |
| 28 void ExecuteCommand(int command_id) override; |
| 29 void OnMenuCancel() override; |
| 30 |
| 31 private: |
| 32 RenderViewContextMenuProxy* const proxy_; |
| 33 int num_items_initially_enabled_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(OpenWithMenuObserver); |
| 36 }; |
| 37 |
| 38 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_ |
OLD | NEW |