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 "chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.h" | 5 #include "chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.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/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/android/resource_mapper.h" | 10 #include "chrome/browser/android/resource_mapper.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 web_contents, base::android::ConvertJavaStringToUTF8(env, jlink_url)); | 24 web_contents, base::android::ConvertJavaStringToUTF8(env, jlink_url)); |
25 } | 25 } |
26 | 26 |
27 // static | 27 // static |
28 bool DataReductionProxyInfoBar::Register(JNIEnv* env) { | 28 bool DataReductionProxyInfoBar::Register(JNIEnv* env) { |
29 return RegisterNativesImpl(env); | 29 return RegisterNativesImpl(env); |
30 } | 30 } |
31 | 31 |
32 DataReductionProxyInfoBar::DataReductionProxyInfoBar( | 32 DataReductionProxyInfoBar::DataReductionProxyInfoBar( |
33 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) | 33 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) |
34 : ConfirmInfoBar(delegate.PassAs<ConfirmInfoBarDelegate>()), | 34 : ConfirmInfoBar(delegate.Pass()), java_data_reduction_proxy_delegate_() { |
35 java_data_reduction_proxy_delegate_() { | |
36 } | 35 } |
37 | 36 |
38 DataReductionProxyInfoBar::~DataReductionProxyInfoBar() { | 37 DataReductionProxyInfoBar::~DataReductionProxyInfoBar() { |
39 } | 38 } |
40 | 39 |
41 base::android::ScopedJavaLocalRef<jobject> | 40 base::android::ScopedJavaLocalRef<jobject> |
42 DataReductionProxyInfoBar::CreateRenderInfoBar(JNIEnv* env) { | 41 DataReductionProxyInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
43 java_data_reduction_proxy_delegate_.Reset( | 42 java_data_reduction_proxy_delegate_.Reset( |
44 Java_DataReductionProxyInfoBarDelegate_create(env)); | 43 Java_DataReductionProxyInfoBarDelegate_create(env)); |
45 | 44 |
(...skipping 17 matching lines...) Expand all Loading... |
63 return scoped_ptr<infobars::InfoBar>( | 62 return scoped_ptr<infobars::InfoBar>( |
64 new DataReductionProxyInfoBar(delegate.Pass())); | 63 new DataReductionProxyInfoBar(delegate.Pass())); |
65 } | 64 } |
66 | 65 |
67 | 66 |
68 // JNI for DataReductionProxyInfoBarDelegate. | 67 // JNI for DataReductionProxyInfoBarDelegate. |
69 void | 68 void |
70 Launch(JNIEnv* env, jclass clazz, jobject jweb_contents, jstring jlink_url) { | 69 Launch(JNIEnv* env, jclass clazz, jobject jweb_contents, jstring jlink_url) { |
71 DataReductionProxyInfoBar::Launch(env, clazz, jweb_contents, jlink_url); | 70 DataReductionProxyInfoBar::Launch(env, clazz, jweb_contents, jlink_url); |
72 } | 71 } |
OLD | NEW |