OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/net/spdyproxy/data_reduction_promo_infobar_delegate_and
roid.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_and
roid.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "jni/DataReductionPromoInfoBarDelegate_jni.h" | 11 #include "jni/DataReductionPromoInfoBarDelegate_jni.h" |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 | 13 |
| 14 using base::android::JavaParamRef; |
| 15 |
14 // static | 16 // static |
15 void DataReductionPromoInfoBarDelegateAndroid::Create( | 17 void DataReductionPromoInfoBarDelegateAndroid::Create( |
16 content::WebContents* web_contents) { | 18 content::WebContents* web_contents) { |
17 InfoBarService* infobar_service = | 19 InfoBarService* infobar_service = |
18 InfoBarService::FromWebContents(web_contents); | 20 InfoBarService::FromWebContents(web_contents); |
19 infobar_service->AddInfoBar( | 21 infobar_service->AddInfoBar( |
20 DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar( | 22 DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar( |
21 infobar_service, | 23 infobar_service, |
22 base::MakeUnique<DataReductionPromoInfoBarDelegateAndroid>())); | 24 base::MakeUnique<DataReductionPromoInfoBarDelegateAndroid>())); |
23 } | 25 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 Java_DataReductionPromoInfoBarDelegate_accept(env); | 68 Java_DataReductionPromoInfoBarDelegate_accept(env); |
67 return true; | 69 return true; |
68 } | 70 } |
69 | 71 |
70 // JNI for DataReductionPromoInfoBarDelegate. | 72 // JNI for DataReductionPromoInfoBarDelegate. |
71 void Launch(JNIEnv* env, | 73 void Launch(JNIEnv* env, |
72 const JavaParamRef<jclass>& clazz, | 74 const JavaParamRef<jclass>& clazz, |
73 const JavaParamRef<jobject>& jweb_contents) { | 75 const JavaParamRef<jobject>& jweb_contents) { |
74 DataReductionPromoInfoBarDelegateAndroid::Launch(env, clazz, jweb_contents); | 76 DataReductionPromoInfoBarDelegateAndroid::Launch(env, clazz, jweb_contents); |
75 } | 77 } |
OLD | NEW |