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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 DataReductionProxyInfoBar::~DataReductionProxyInfoBar() { | 37 DataReductionProxyInfoBar::~DataReductionProxyInfoBar() { |
38 } | 38 } |
39 | 39 |
40 base::android::ScopedJavaLocalRef<jobject> | 40 base::android::ScopedJavaLocalRef<jobject> |
41 DataReductionProxyInfoBar::CreateRenderInfoBar(JNIEnv* env) { | 41 DataReductionProxyInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
42 java_data_reduction_proxy_delegate_.Reset( | 42 java_data_reduction_proxy_delegate_.Reset( |
43 Java_DataReductionProxyInfoBarDelegate_create(env)); | 43 Java_DataReductionProxyInfoBarDelegate_create(env)); |
44 | 44 |
45 return Java_DataReductionProxyInfoBarDelegate_showDataReductionProxyInfoBar( | 45 return Java_DataReductionProxyInfoBarDelegate_showDataReductionProxyInfoBar( |
46 env, | 46 env, java_data_reduction_proxy_delegate_.obj(), GetEnumeratedIconId()); |
47 java_data_reduction_proxy_delegate_.obj(), | |
48 reinterpret_cast<intptr_t>(this), | |
49 GetEnumeratedIconId()); | |
50 } | 47 } |
51 | 48 |
52 DataReductionProxyInfoBarDelegate* DataReductionProxyInfoBar::GetDelegate() { | 49 DataReductionProxyInfoBarDelegate* DataReductionProxyInfoBar::GetDelegate() { |
53 return static_cast<DataReductionProxyInfoBarDelegate*>(delegate()); | 50 return static_cast<DataReductionProxyInfoBarDelegate*>(delegate()); |
54 } | 51 } |
55 | 52 |
56 | 53 |
57 // DataReductionProxyInfoBarDelegate: | 54 // DataReductionProxyInfoBarDelegate: |
58 | 55 |
59 // static | 56 // static |
60 scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( | 57 scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( |
61 infobars::InfoBarManager* infobar_manager, | 58 infobars::InfoBarManager* infobar_manager, |
62 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { | 59 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { |
63 return scoped_ptr<infobars::InfoBar>( | 60 return scoped_ptr<infobars::InfoBar>( |
64 new DataReductionProxyInfoBar(delegate.Pass())); | 61 new DataReductionProxyInfoBar(delegate.Pass())); |
65 } | 62 } |
66 | 63 |
67 | 64 |
68 // JNI for DataReductionProxyInfoBarDelegate. | 65 // JNI for DataReductionProxyInfoBarDelegate. |
69 void | 66 void |
70 Launch(JNIEnv* env, jclass clazz, jobject jweb_contents, jstring jlink_url) { | 67 Launch(JNIEnv* env, jclass clazz, jobject jweb_contents, jstring jlink_url) { |
71 DataReductionProxyInfoBar::Launch(env, clazz, jweb_contents, jlink_url); | 68 DataReductionProxyInfoBar::Launch(env, clazz, jweb_contents, jlink_url); |
72 } | 69 } |
OLD | NEW |