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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include "android_webview/browser/net_disk_cache_remover.h" | 7 #include "android_webview/browser/net_disk_cache_remover.h" |
8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
9 #include "android_webview/native/aw_browser_dependency_factory.h" | 9 #include "android_webview/native/aw_browser_dependency_factory.h" |
10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
11 #include "android_webview/native/aw_web_contents_delegate.h" | 11 #include "android_webview/native/aw_web_contents_delegate.h" |
12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
13 #include "base/android/jni_array.h" | 13 #include "base/android/jni_array.h" |
14 #include "base/android/jni_string.h" | 14 #include "base/android/jni_string.h" |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
18 #include "chrome/browser/component/navigation_interception/intercept_navigation_
delegate.h" | 18 #include "content/components/navigation_interception/intercept_navigation_delega
te.h" |
19 #include "content/public/browser/android/content_view_core.h" | 19 #include "content/public/browser/android/content_view_core.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/browser/cert_store.h" | 21 #include "content/public/browser/cert_store.h" |
22 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
24 #include "content/public/common/ssl_status.h" | 24 #include "content/public/common/ssl_status.h" |
25 #include "jni/AwContents_jni.h" | 25 #include "jni/AwContents_jni.h" |
26 #include "net/base/x509_certificate.h" | 26 #include "net/base/x509_certificate.h" |
27 | 27 |
28 using base::android::AttachCurrentThread; | 28 using base::android::AttachCurrentThread; |
29 using base::android::ConvertJavaStringToUTF16; | 29 using base::android::ConvertJavaStringToUTF16; |
30 using base::android::ConvertJavaStringToUTF8; | 30 using base::android::ConvertJavaStringToUTF8; |
31 using base::android::ConvertUTF16ToJavaString; | 31 using base::android::ConvertUTF16ToJavaString; |
32 using base::android::ConvertUTF8ToJavaString; | 32 using base::android::ConvertUTF8ToJavaString; |
33 using base::android::JavaRef; | 33 using base::android::JavaRef; |
34 using base::android::ScopedJavaGlobalRef; | 34 using base::android::ScopedJavaGlobalRef; |
35 using base::android::ScopedJavaLocalRef; | 35 using base::android::ScopedJavaLocalRef; |
36 using content::BrowserThread; | 36 using content::BrowserThread; |
37 using content::ContentViewCore; | 37 using content::ContentViewCore; |
| 38 using content::InterceptNavigationDelegate; |
38 using content::WebContents; | 39 using content::WebContents; |
39 using navigation_interception::InterceptNavigationDelegate; | |
40 | 40 |
41 namespace android_webview { | 41 namespace android_webview { |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 const void* kAwContentsUserDataKey = &kAwContentsUserDataKey; | 45 const void* kAwContentsUserDataKey = &kAwContentsUserDataKey; |
46 | 46 |
47 class AwContentsUserData : public base::SupportsUserData::Data { | 47 class AwContentsUserData : public base::SupportsUserData::Data { |
48 public: | 48 public: |
49 AwContentsUserData(AwContents* ptr) : contents_(ptr) {} | 49 AwContentsUserData(AwContents* ptr) : contents_(ptr) {} |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return ScopedJavaLocalRef<jbyteArray>(); | 302 return ScopedJavaLocalRef<jbyteArray>(); |
303 | 303 |
304 // Convert the certificate and return it | 304 // Convert the certificate and return it |
305 std::string der_string; | 305 std::string der_string; |
306 net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_string); | 306 net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_string); |
307 return base::android::ToJavaByteArray(env, | 307 return base::android::ToJavaByteArray(env, |
308 reinterpret_cast<const uint8*>(der_string.data()), der_string.length()); | 308 reinterpret_cast<const uint8*>(der_string.data()), der_string.length()); |
309 } | 309 } |
310 | 310 |
311 } // namespace android_webview | 311 } // namespace android_webview |
OLD | NEW |