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 #include "chrome/browser/ui/android/context_menu_helper.h" | 5 #include "chrome/browser/ui/android/context_menu_helper.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "content/public/browser/android/content_view_core.h" | 9 #include "content/public/browser/android/content_view_core.h" |
10 #include "content/public/browser/android/download_controller_android.h" | 10 #include "content/public/browser/android/download_controller_android.h" |
11 #include "content/public/common/context_menu_params.h" | 11 #include "content/public/common/context_menu_params.h" |
12 #include "jni/ContextMenuHelper_jni.h" | 12 #include "jni/ContextMenuHelper_jni.h" |
13 #include "jni/ContextMenuParams_jni.h" | 13 #include "jni/ContextMenuParams_jni.h" |
14 #include "ui/gfx/point.h" | 14 #include "ui/gfx/geometry/point.h" |
15 | 15 |
16 using base::android::ConvertUTF8ToJavaString; | 16 using base::android::ConvertUTF8ToJavaString; |
17 using base::android::ConvertUTF16ToJavaString; | 17 using base::android::ConvertUTF16ToJavaString; |
18 using base::android::ScopedJavaLocalRef; | 18 using base::android::ScopedJavaLocalRef; |
19 | 19 |
20 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ContextMenuHelper); | 20 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ContextMenuHelper); |
21 | 21 |
22 ContextMenuHelper::ContextMenuHelper(content::WebContents* web_contents) | 22 ContextMenuHelper::ContextMenuHelper(content::WebContents* web_contents) |
23 : web_contents_(web_contents) { | 23 : web_contents_(web_contents) { |
24 JNIEnv* env = base::android::AttachCurrentThread(); | 24 JNIEnv* env = base::android::AttachCurrentThread(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 content::DownloadControllerAndroid::Get()->StartContextMenuDownload( | 110 content::DownloadControllerAndroid::Get()->StartContextMenuDownload( |
111 context_menu_params_, | 111 context_menu_params_, |
112 web_contents_, | 112 web_contents_, |
113 jis_link); | 113 jis_link); |
114 } | 114 } |
115 | 115 |
116 bool RegisterContextMenuHelper(JNIEnv* env) { | 116 bool RegisterContextMenuHelper(JNIEnv* env) { |
117 return RegisterNativesImpl(env) && | 117 return RegisterNativesImpl(env) && |
118 ContextMenuParamsAndroid::RegisterNativesImpl(env); | 118 ContextMenuParamsAndroid::RegisterNativesImpl(env); |
119 } | 119 } |
OLD | NEW |