OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/android/infobars/data_reduction_promo_infobar.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" |
| 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" |
| 13 #include "chrome/browser/android/resource_mapper.h" |
| 14 #include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_and
roid.h" |
| 15 #include "content/public/browser/web_contents.h" |
| 16 |
| 17 // DataReductionPromoInfoBar -------------------------------------------------- |
| 18 |
| 19 DataReductionPromoInfoBar::DataReductionPromoInfoBar( |
| 20 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate) |
| 21 : ConfirmInfoBar(std::move(delegate)) {} |
| 22 |
| 23 DataReductionPromoInfoBar::~DataReductionPromoInfoBar() { |
| 24 } |
| 25 |
| 26 base::android::ScopedJavaLocalRef<jobject> |
| 27 DataReductionPromoInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
| 28 return GetDelegate()->CreateRenderInfoBar(env); |
| 29 } |
| 30 |
| 31 DataReductionPromoInfoBarDelegateAndroid* |
| 32 DataReductionPromoInfoBar::GetDelegate() { |
| 33 return static_cast<DataReductionPromoInfoBarDelegateAndroid*>(delegate()); |
| 34 } |
| 35 |
| 36 // DataReductionPromoInfoBarDelegate ------------------------------------------ |
| 37 |
| 38 // static |
| 39 std::unique_ptr<infobars::InfoBar> |
| 40 DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar( |
| 41 infobars::InfoBarManager* infobar_manager, |
| 42 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate) { |
| 43 return base::MakeUnique<DataReductionPromoInfoBar>(std::move(delegate)); |
| 44 } |
OLD | NEW |