| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/download/chrome_download_delegate.h" | 5 #include "chrome/browser/android/download/chrome_download_delegate.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <type_traits> | 10 #include <type_traits> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 void ChromeDownloadDelegate::RequestFileAccess(intptr_t callback_id) { | 200 void ChromeDownloadDelegate::RequestFileAccess(intptr_t callback_id) { |
| 201 JNIEnv* env = base::android::AttachCurrentThread(); | 201 JNIEnv* env = base::android::AttachCurrentThread(); |
| 202 Java_ChromeDownloadDelegate_requestFileAccess( | 202 Java_ChromeDownloadDelegate_requestFileAccess( |
| 203 env, java_ref_, callback_id); | 203 env, java_ref_, callback_id); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void Init(JNIEnv* env, | 206 void Init(JNIEnv* env, |
| 207 const JavaParamRef<jobject>& obj, | 207 const JavaParamRef<jobject>& obj, |
| 208 const JavaParamRef<jobject>& jweb_contents) { | 208 const JavaParamRef<jobject>& jweb_contents) { |
| 209 auto web_contents = WebContents::FromJavaWebContents(jweb_contents); | 209 auto* web_contents = WebContents::FromJavaWebContents(jweb_contents); |
| 210 ChromeDownloadDelegate::CreateForWebContents(web_contents); | 210 ChromeDownloadDelegate::CreateForWebContents(web_contents); |
| 211 ChromeDownloadDelegate::FromWebContents(web_contents)->SetJavaRef(env, obj); | 211 ChromeDownloadDelegate::FromWebContents(web_contents)->SetJavaRef(env, obj); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool RegisterChromeDownloadDelegate(JNIEnv* env) { | 214 bool RegisterChromeDownloadDelegate(JNIEnv* env) { |
| 215 return RegisterNativesImpl(env); | 215 return RegisterNativesImpl(env); |
| 216 } | 216 } |
| 217 | 217 |
| 218 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeDownloadDelegate); | 218 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeDownloadDelegate); |
| OLD | NEW |