OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/android/interstitial_page_delegate_android.h" | 5 #include "content/browser/android/interstitial_page_delegate_android.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 "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "content/public/browser/interstitial_page.h" | 10 #include "content/public/browser/interstitial_page.h" |
11 #include "jni/InterstitialPageDelegateAndroid_jni.h" | 11 #include "jni/InterstitialPageDelegateAndroid_jni.h" |
12 | 12 |
13 using base::android::AttachCurrentThread; | 13 using base::android::AttachCurrentThread; |
| 14 using base::android::JavaParamRef; |
14 using base::android::ScopedJavaLocalRef; | 15 using base::android::ScopedJavaLocalRef; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 InterstitialPageDelegateAndroid::InterstitialPageDelegateAndroid( | 19 InterstitialPageDelegateAndroid::InterstitialPageDelegateAndroid( |
19 JNIEnv* env, | 20 JNIEnv* env, |
20 jobject obj, | 21 jobject obj, |
21 const std::string& html_content) | 22 const std::string& html_content) |
22 : weak_java_obj_(env, obj), | 23 : weak_java_obj_(env, obj), |
23 html_content_(html_content), | 24 html_content_(html_content), |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 static jlong Init(JNIEnv* env, | 91 static jlong Init(JNIEnv* env, |
91 const JavaParamRef<jobject>& obj, | 92 const JavaParamRef<jobject>& obj, |
92 const JavaParamRef<jstring>& html_content) { | 93 const JavaParamRef<jstring>& html_content) { |
93 InterstitialPageDelegateAndroid* delegate = | 94 InterstitialPageDelegateAndroid* delegate = |
94 new InterstitialPageDelegateAndroid( | 95 new InterstitialPageDelegateAndroid( |
95 env, obj, base::android::ConvertJavaStringToUTF8(env, html_content)); | 96 env, obj, base::android::ConvertJavaStringToUTF8(env, html_content)); |
96 return reinterpret_cast<intptr_t>(delegate); | 97 return reinterpret_cast<intptr_t>(delegate); |
97 } | 98 } |
98 | 99 |
99 } // namespace content | 100 } // namespace content |
OLD | NEW |