| 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 "components/service_tab_launcher/browser/android/service_tab_launcher.h
" | 5 #include "components/service_tab_launcher/browser/android/service_tab_launcher.h
" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 JNIEnv* env = AttachCurrentThread(); | 63 JNIEnv* env = AttachCurrentThread(); |
| 64 ScopedJavaLocalRef<jstring> url = ConvertUTF8ToJavaString( | 64 ScopedJavaLocalRef<jstring> url = ConvertUTF8ToJavaString( |
| 65 env, params.url.spec()); | 65 env, params.url.spec()); |
| 66 ScopedJavaLocalRef<jstring> referrer_url = | 66 ScopedJavaLocalRef<jstring> referrer_url = |
| 67 ConvertUTF8ToJavaString(env, params.referrer.url.spec()); | 67 ConvertUTF8ToJavaString(env, params.referrer.url.spec()); |
| 68 ScopedJavaLocalRef<jstring> headers = ConvertUTF8ToJavaString( | 68 ScopedJavaLocalRef<jstring> headers = ConvertUTF8ToJavaString( |
| 69 env, params.extra_headers); | 69 env, params.extra_headers); |
| 70 | 70 |
| 71 ScopedJavaLocalRef<jbyteArray> post_data; | 71 ScopedJavaLocalRef<jobject> post_data; |
| 72 | 72 |
| 73 int request_id = tab_launched_callbacks_.Add( | 73 int request_id = tab_launched_callbacks_.Add( |
| 74 new TabLaunchedCallback(callback)); | 74 new TabLaunchedCallback(callback)); |
| 75 DCHECK_GE(request_id, 1); | 75 DCHECK_GE(request_id, 1); |
| 76 | 76 |
| 77 Java_ServiceTabLauncher_launchTab(env, | 77 Java_ServiceTabLauncher_launchTab(env, |
| 78 java_object_.obj(), | 78 java_object_.obj(), |
| 79 GetApplicationContext(), | 79 GetApplicationContext(), |
| 80 request_id, | 80 request_id, |
| 81 browser_context->IsOffTheRecord(), | 81 browser_context->IsOffTheRecord(), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 96 callback->Run(web_contents); | 96 callback->Run(web_contents); |
| 97 | 97 |
| 98 tab_launched_callbacks_.Remove(request_id); | 98 tab_launched_callbacks_.Remove(request_id); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool ServiceTabLauncher::RegisterServiceTabLauncher(JNIEnv* env) { | 101 bool ServiceTabLauncher::RegisterServiceTabLauncher(JNIEnv* env) { |
| 102 return RegisterNativesImpl(env); | 102 return RegisterNativesImpl(env); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace service_tab_launcher | 105 } // namespace service_tab_launcher |
| OLD | NEW |