Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/ui/android/context_menu_helper.cc

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix failing tests/bugs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "chrome/browser/android/download/download_controller_base.h"
12 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
13 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h" 14 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h"
14 #include "content/public/browser/android/content_view_core.h" 15 #include "content/public/browser/android/content_view_core.h"
15 #include "content/public/browser/android/download_controller_android.h"
16 #include "content/public/browser/render_frame_host.h" 16 #include "content/public/browser/render_frame_host.h"
17 #include "content/public/browser/render_process_host.h" 17 #include "content/public/browser/render_process_host.h"
18 #include "content/public/common/context_menu_params.h" 18 #include "content/public/common/context_menu_params.h"
19 #include "jni/ContextMenuHelper_jni.h" 19 #include "jni/ContextMenuHelper_jni.h"
20 #include "jni/ContextMenuParams_jni.h" 20 #include "jni/ContextMenuParams_jni.h"
21 #include "ui/android/window_android.h" 21 #include "ui/android/window_android.h"
22 #include "ui/gfx/geometry/point.h" 22 #include "ui/gfx/geometry/point.h"
23 23
24 using base::android::ConvertJavaStringToUTF8; 24 using base::android::ConvertJavaStringToUTF8;
25 using base::android::ConvertUTF8ToJavaString; 25 using base::android::ConvertUTF8ToJavaString;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 void ContextMenuHelper::OnStartDownload( 110 void ContextMenuHelper::OnStartDownload(
111 JNIEnv* env, 111 JNIEnv* env,
112 const JavaParamRef<jobject>& obj, 112 const JavaParamRef<jobject>& obj,
113 jboolean jis_link, 113 jboolean jis_link,
114 jboolean jis_data_reduction_proxy_enabled) { 114 jboolean jis_data_reduction_proxy_enabled) {
115 std::string headers; 115 std::string headers;
116 if (jis_data_reduction_proxy_enabled) 116 if (jis_data_reduction_proxy_enabled)
117 headers = kDataReductionProxyPassthroughHeader; 117 headers = kDataReductionProxyPassthroughHeader;
118 118
119 content::DownloadControllerAndroid::Get()->StartContextMenuDownload( 119 DownloadControllerBase::Get()->StartContextMenuDownload(
120 context_menu_params_, 120 context_menu_params_,
121 web_contents_, 121 web_contents_,
122 jis_link, 122 jis_link,
123 headers); 123 headers);
124 } 124 }
125 125
126 void ContextMenuHelper::SearchForImage(JNIEnv* env, 126 void ContextMenuHelper::SearchForImage(JNIEnv* env,
127 const JavaParamRef<jobject>& obj) { 127 const JavaParamRef<jobject>& obj) {
128 content::RenderFrameHost* render_frame_host = 128 content::RenderFrameHost* render_frame_host =
129 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); 129 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 env, 173 env,
174 java_obj_.obj(), 174 java_obj_.obj(),
175 jwindow_android.obj(), 175 jwindow_android.obj(),
176 j_bytes.obj()); 176 j_bytes.obj());
177 } 177 }
178 178
179 bool RegisterContextMenuHelper(JNIEnv* env) { 179 bool RegisterContextMenuHelper(JNIEnv* env) {
180 return RegisterNativesImpl(env) && 180 return RegisterNativesImpl(env) &&
181 ContextMenuParamsAndroid::RegisterNativesImpl(env); 181 ContextMenuParamsAndroid::RegisterNativesImpl(env);
182 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698