OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_statics.h" | 5 #include "android_webview/native/aw_contents_statics.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.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 "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 // static | 53 // static |
54 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { | 54 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { |
55 AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); | 55 AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); |
56 DCHECK(browser_context); | 56 DCHECK(browser_context); |
57 DataReductionProxyAuthRequestHandler* drp_auth_request_handler = | 57 DataReductionProxyAuthRequestHandler* drp_auth_request_handler = |
58 browser_context->GetDataReductionProxyAuthRequestHandler(); | 58 browser_context->GetDataReductionProxyAuthRequestHandler(); |
59 if (drp_auth_request_handler) | 59 if (drp_auth_request_handler) |
60 drp_auth_request_handler->SetKey( | 60 drp_auth_request_handler->SetKey( |
61 ConvertJavaStringToUTF8(env, key), | 61 ConvertJavaStringToUTF8(env, key)); |
62 data_reduction_proxy::kClientAndroidWebview, | |
63 data_reduction_proxy::kProtocolVersion); | |
64 } | 62 } |
65 | 63 |
66 // static | 64 // static |
67 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { | 65 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { |
68 AwBrowserContext::SetDataReductionProxyEnabled(enabled); | 66 AwBrowserContext::SetDataReductionProxyEnabled(enabled); |
69 } | 67 } |
70 | 68 |
71 // static | 69 // static |
72 jstring GetUnreachableWebDataUrl(JNIEnv* env, jclass) { | 70 jstring GetUnreachableWebDataUrl(JNIEnv* env, jclass) { |
73 return base::android::ConvertUTF8ToJavaString( | 71 return base::android::ConvertUTF8ToJavaString( |
74 env, content::kUnreachableWebDataURL).Release(); | 72 env, content::kUnreachableWebDataURL).Release(); |
75 } | 73 } |
76 | 74 |
77 // static | 75 // static |
78 void SetRecordFullDocument(JNIEnv* env, jclass, jboolean record_full_document) { | 76 void SetRecordFullDocument(JNIEnv* env, jclass, jboolean record_full_document) { |
79 content::SynchronousCompositor::SetRecordFullDocument(record_full_document); | 77 content::SynchronousCompositor::SetRecordFullDocument(record_full_document); |
80 } | 78 } |
81 | 79 |
82 bool RegisterAwContentsStatics(JNIEnv* env) { | 80 bool RegisterAwContentsStatics(JNIEnv* env) { |
83 return RegisterNativesImpl(env); | 81 return RegisterNativesImpl(env); |
84 } | 82 } |
85 | 83 |
86 } // namespace android_webview | 84 } // namespace android_webview |
OLD | NEW |