| Index: chrome/browser/renderer_context_menu/open_with_menu_observer.h
|
| diff --git a/chrome/browser/renderer_context_menu/open_with_menu_observer.h b/chrome/browser/renderer_context_menu/open_with_menu_observer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..71970436ca69db9f6275573bd7e44dd5bfc8e6ac
|
| --- /dev/null
|
| +++ b/chrome/browser/renderer_context_menu/open_with_menu_observer.h
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_
|
| +#define CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_
|
| +
|
| +#include <set>
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "base/macros.h"
|
| +#include "components/renderer_context_menu/render_view_context_menu_observer.h"
|
| +
|
| +class RenderViewContextMenuProxy;
|
| +
|
| +// An observer that listens to events from the RenderViewContextMenu class and
|
| +// shows app names received from ARC that can handle the current URL.
|
| +class OpenWithMenuObserver : public RenderViewContextMenuObserver {
|
| + public:
|
| + explicit OpenWithMenuObserver(RenderViewContextMenuProxy* proxy);
|
| + ~OpenWithMenuObserver() override;
|
| +
|
| + // RenderViewContextMenuObserver implementation.
|
| + void InitMenu(const content::ContextMenuParams& params) override;
|
| + bool IsCommandIdSupported(int command_id) override;
|
| + bool IsCommandIdChecked(int command_id) override;
|
| + bool IsCommandIdEnabled(int command_id) override;
|
| + void ExecuteCommand(int command_id) override;
|
| + void OnMenuCancel() override;
|
| +
|
| + private:
|
| + RenderViewContextMenuProxy* const proxy_;
|
| + int num_items_initially_enabled_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(OpenWithMenuObserver);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_OBSERVER_H_
|
|
|