blob: 4eae8761d3d538b48afbfac7ac2613494a5fe5db [file] [log] [blame]
[email protected]e96226872013-12-06 00:02:371// Copyright 2013 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_UI_ANDROID_CONTEXT_MENU_HELPER_H_
6#define CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_
7
dcheng9603ab92016-04-08 04:17:328#include <memory>
tedchoc23990ba2015-10-29 18:48:489#include <string>
watk2c472002017-03-14 05:52:2810#include <vector>
tedchoc23990ba2015-10-29 18:48:4811
[email protected]e96226872013-12-06 00:02:3712#include "base/android/jni_android.h"
tedchoc69a502c2017-04-07 18:11:3613#include "base/android/scoped_java_ref.h"
avi655876a2015-12-25 07:18:1514#include "base/macros.h"
Nicholas Vernec6b829a2017-10-24 13:43:5615#include "chrome/common/chrome_render_frame.mojom.h"
Josh Simmons6067fdb2020-01-17 08:56:5016#include "components/optimization_guide/proto/performance_hints_metadata.pb.h"
Lukasz Anforowicz8c4446dc2020-03-11 22:16:4217#include "content/public/browser/context_menu_params.h"
Jinsuk Kim6d4d86e2020-05-14 12:10:1518#include "content/public/browser/render_frame_host.h"
[email protected]e96226872013-12-06 00:02:3719#include "content/public/browser/web_contents_user_data.h"
[email protected]e96226872013-12-06 00:02:3720
21namespace content {
[email protected]e96226872013-12-06 00:02:3722class WebContents;
23}
24
25class ContextMenuHelper
26 : public content::WebContentsUserData<ContextMenuHelper> {
27 public:
dcheng361fdb32015-02-04 02:56:0728 ~ContextMenuHelper() override;
[email protected]e96226872013-12-06 00:02:3729
amaralpdbb23e22016-09-26 22:40:1130 void ShowContextMenu(content::RenderFrameHost* render_frame_host,
tedchoccd0bf1f2015-12-15 21:23:1031 const content::ContextMenuParams& params);
[email protected]e96226872013-12-06 00:02:3732
shaktisahu3a2f73d2016-12-06 04:34:3133 void OnContextMenuClosed(JNIEnv* env,
34 const base::android::JavaParamRef<jobject>& obj);
35
Torne (Richard Coles)0a108752017-07-25 15:08:4136 void SetPopulator(const base::android::JavaRef<jobject>& jpopulator);
[email protected]e96226872013-12-06 00:02:3737
Gang Wu6599f0ba2020-04-02 05:57:2338 private:
39 explicit ContextMenuHelper(content::WebContents* web_contents);
40 friend class content::WebContentsUserData<ContextMenuHelper>;
41
Gang Wu6599f0ba2020-04-02 05:57:2342 mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame>
43 GetChromeRenderFrame() const;
[email protected]e96226872013-12-06 00:02:3744
[email protected]e96226872013-12-06 00:02:3745 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
46 content::WebContents* web_contents_;
47
[email protected]e96226872013-12-06 00:02:3748 content::ContextMenuParams context_menu_params_;
[email protected]e96226872013-12-06 00:02:3749
François Doray4f51d5d2018-12-03 22:26:2450 WEB_CONTENTS_USER_DATA_KEY_DECL();
51
[email protected]e96226872013-12-06 00:02:3752 DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper);
53};
54
[email protected]e96226872013-12-06 00:02:3755#endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_