| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class ContextMenuHelper | 22 class ContextMenuHelper |
| 23 : public content::WebContentsUserData<ContextMenuHelper> { | 23 : public content::WebContentsUserData<ContextMenuHelper> { |
| 24 public: | 24 public: |
| 25 ~ContextMenuHelper() override; | 25 ~ContextMenuHelper() override; |
| 26 | 26 |
| 27 void ShowContextMenu(const content::ContextMenuParams& params); | 27 void ShowContextMenu(const content::ContextMenuParams& params); |
| 28 | 28 |
| 29 void SetPopulator(jobject jpopulator); | 29 void SetPopulator(jobject jpopulator); |
| 30 | 30 |
| 31 // Methods called from Java via JNI ------------------------------------------ | 31 // Methods called from Java via JNI ------------------------------------------ |
| 32 void OnStartDownload( | 32 void OnStartDownload(JNIEnv* env, |
| 33 JNIEnv* env, jobject obj, jboolean jis_link, jstring jheaders); | 33 const base::android::JavaParamRef<jobject>& obj, |
| 34 void SearchForImage(JNIEnv* env, jobject obj); | 34 jboolean jis_link, |
| 35 void ShareImage(JNIEnv* env, jobject obj); | 35 const base::android::JavaParamRef<jstring>& jheaders); |
| 36 void SearchForImage(JNIEnv* env, |
| 37 const base::android::JavaParamRef<jobject>& obj); |
| 38 void ShareImage(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 explicit ContextMenuHelper(content::WebContents* web_contents); | 41 explicit ContextMenuHelper(content::WebContents* web_contents); |
| 39 friend class content::WebContentsUserData<ContextMenuHelper>; | 42 friend class content::WebContentsUserData<ContextMenuHelper>; |
| 40 | 43 |
| 41 static base::android::ScopedJavaLocalRef<jobject> CreateJavaContextMenuParams( | 44 static base::android::ScopedJavaLocalRef<jobject> CreateJavaContextMenuParams( |
| 42 const content::ContextMenuParams& params); | 45 const content::ContextMenuParams& params); |
| 43 | 46 |
| 44 void OnShareImage(const std::string& thumbnail_data, | 47 void OnShareImage(const std::string& thumbnail_data, |
| 45 const gfx::Size& original_size); | 48 const gfx::Size& original_size); |
| 46 | 49 |
| 47 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 50 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 48 content::WebContents* web_contents_; | 51 content::WebContents* web_contents_; |
| 49 | 52 |
| 50 content::ContextMenuParams context_menu_params_; | 53 content::ContextMenuParams context_menu_params_; |
| 51 | 54 |
| 52 DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper); | 55 DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 bool RegisterContextMenuHelper(JNIEnv* env); | 58 bool RegisterContextMenuHelper(JNIEnv* env); |
| 56 | 59 |
| 57 #endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ | 60 #endif // CHROME_BROWSER_UI_ANDROID_CONTEXT_MENU_HELPER_H_ |
| OLD | NEW |