Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Side by Side Diff: android_webview/native/aw_contents_statics.cc

Issue 279633003: Use non-static set_key interface on DataReductionProxySettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
8 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
9 #include "base/callback.h" 10 #include "base/callback.h"
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
11 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
12 #include "jni/AwContentsStatics_jni.h" 13 #include "jni/AwContentsStatics_jni.h"
13 #include "net/cert/cert_database.h" 14 #include "net/cert/cert_database.h"
14 15
15 using base::android::AttachCurrentThread; 16 using base::android::AttachCurrentThread;
16 using base::android::ConvertJavaStringToUTF8; 17 using base::android::ConvertJavaStringToUTF8;
(...skipping 25 matching lines...) Expand all
42 j_callback->Reset(env, callback); 43 j_callback->Reset(env, callback);
43 BrowserThread::PostTaskAndReply( 44 BrowserThread::PostTaskAndReply(
44 BrowserThread::IO, 45 BrowserThread::IO,
45 FROM_HERE, 46 FROM_HERE,
46 base::Bind(&NotifyClientCertificatesChanged), 47 base::Bind(&NotifyClientCertificatesChanged),
47 base::Bind(&ClientCertificatesCleared, base::Owned(j_callback))); 48 base::Bind(&ClientCertificatesCleared, base::Owned(j_callback)));
48 } 49 }
49 50
50 // static 51 // static
51 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { 52 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) {
52 DataReductionProxySettings::SetKey(ConvertJavaStringToUTF8(env, key)); 53 AwBrowserContext* browser_context = AwBrowserContext::GetDefault();
54 DCHECK(browser_context);
55 DataReductionProxySettings* drp_settings =
56 browser_context->GetDataReductionProxySettings();
57 DCHECK(drp_settings);
58 drp_settings->set_key(ConvertJavaStringToUTF8(env, key));
sgurun-gerrit only 2014/05/09 17:40:26 fix the alignment?
bengr 2014/05/09 17:54:24 Done.
53 } 59 }
54 60
55 bool RegisterAwContentsStatics(JNIEnv* env) { 61 bool RegisterAwContentsStatics(JNIEnv* env) {
56 return RegisterNativesImpl(env); 62 return RegisterNativesImpl(env);
57 } 63 }
58 64
59 } // namespace android_webview 65 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698