blob: 0625e669e6909fc2abd4b10ab4f912c576677059 [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
[email protected]e96226872013-12-06 00:02:378#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:
dcheng361fdb32015-02-04 02:56:0724 ~ContextMenuHelper() override;
[email protected]e96226872013-12-06 00:02:3725
amaralpdbb23e22016-09-26 22:40:1126 void ShowContextMenu(content::RenderFrameHost* render_frame_host,
tedchoccd0bf1f2015-12-15 21:23:1027 const content::ContextMenuParams& params);
[email protected]e96226872013-12-06 00:02:3728
shaktisahu3a2f73d2016-12-06 04:34:3129 void OnContextMenuClosed(JNIEnv* env,
30 const base::android::JavaParamRef<jobject>& obj);
31
Sinan Sahin573417612020-09-25 19:21:5032 void SetPopulatorFactory(
33 const base::android::JavaRef<jobject>& jpopulator_factory);
[email protected]e96226872013-12-06 00:02:3734
Gang Wu6599f0ba2020-04-02 05:57:2335 private:
36 explicit ContextMenuHelper(content::WebContents* web_contents);
37 friend class content::WebContentsUserData<ContextMenuHelper>;
38
Gang Wu6599f0ba2020-04-02 05:57:2339 mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame>
40 GetChromeRenderFrame() const;
[email protected]e96226872013-12-06 00:02:3741
[email protected]e96226872013-12-06 00:02:3742 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
43 content::WebContents* web_contents_;
44
[email protected]e96226872013-12-06 00:02:3745 content::ContextMenuParams context_menu_params_;
[email protected]e96226872013-12-06 00:02:3746
François Doray4f51d5d2018-12-03 22:26:2447 WEB_CONTENTS_USER_DATA_KEY_DECL();
48
[email protected]e96226872013-12-06 00:02:3749 DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper);
50};
51
[email protected]e96226872013-12-06 00:02:3752#endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_