BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / android / context_menu_helper.h
blobf57a980ab76af35bb49bb1b2406ae25d40459f48
1 // 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.
5 #ifndef CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_
6 #define CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_
8 #include "base/android/jni_android.h"
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/web_contents_user_data.h"
12 #include "content/public/common/context_menu_params.h"
14 namespace content {
15 struct ContextMenuParams;
16 class WebContents;
19 class ContextMenuHelper
20 : public content::WebContentsUserData<ContextMenuHelper> {
21 public:
22 ~ContextMenuHelper() override;
24 void ShowContextMenu(const content::ContextMenuParams& params);
26 void SetPopulator(jobject jpopulator);
28 // Methods called from Java via JNI ------------------------------------------
29 void OnStartDownload(
30 JNIEnv* env, jobject obj, jboolean jis_link, jstring jheaders);
32 private:
33 explicit ContextMenuHelper(content::WebContents* web_contents);
34 friend class content::WebContentsUserData<ContextMenuHelper>;
36 static base::android::ScopedJavaLocalRef<jobject> CreateJavaContextMenuParams(
37 const content::ContextMenuParams& params);
39 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
40 content::WebContents* web_contents_;
42 content::ContextMenuParams context_menu_params_;
44 DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper);
47 bool RegisterContextMenuHelper(JNIEnv* env);
49 #endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_