blob: 93f113ea95027b51d4338af83e89c58b240c06f5 [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
8#include "base/android/jni_android.h"
tedchoc69a502c2017-04-07 18:11:369#include "base/android/scoped_java_ref.h"
avi655876a2015-12-25 07:18:1510#include "base/macros.h"
Nicholas Vernec6b829a2017-10-24 13:43:5611#include "chrome/common/chrome_render_frame.mojom.h"
Josh Simmons6067fdb2020-01-17 08:56:5012#include "components/optimization_guide/proto/performance_hints_metadata.pb.h"
Lukasz Anforowicz8c4446dc2020-03-11 22:16:4213#include "content/public/browser/context_menu_params.h"
Jinsuk Kim6d4d86e2020-05-14 12:10:1514#include "content/public/browser/render_frame_host.h"
[email protected]e96226872013-12-06 00:02:3715#include "content/public/browser/web_contents_user_data.h"
[email protected]e96226872013-12-06 00:02:3716
17namespace content {
[email protected]e96226872013-12-06 00:02:3718class WebContents;
19}
20
21class ContextMenuHelper
22 : public content::WebContentsUserData<ContextMenuHelper> {
23 public:
Peter Boström53c6c5952021-09-17 09:41:2624 ContextMenuHelper(const ContextMenuHelper&) = delete;
25 ContextMenuHelper& operator=(const ContextMenuHelper&) = delete;
26
dcheng361fdb32015-02-04 02:56:0727 ~ContextMenuHelper() override;
[email protected]e96226872013-12-06 00:02:3728
amaralpdbb23e22016-09-26 22:40:1129 void ShowContextMenu(content::RenderFrameHost* render_frame_host,
tedchoccd0bf1f2015-12-15 21:23:1030 const content::ContextMenuParams& params);
[email protected]e96226872013-12-06 00:02:3731
shaktisahu3a2f73d2016-12-06 04:34:3132 void OnContextMenuClosed(JNIEnv* env,
33 const base::android::JavaParamRef<jobject>& obj);
34
Sinan Sahin573417612020-09-25 19:21:5035 void SetPopulatorFactory(
36 const base::android::JavaRef<jobject>& jpopulator_factory);
[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();
[email protected]e96226872013-12-06 00:02:3751};
52
[email protected]e96226872013-12-06 00:02:3753#endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_