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/instant_apps_infobar.h> |
| 6 |
| 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "chrome/browser/android/instantapps/instant_apps_infobar_delegate.h" |
| 11 #include "jni/InstantAppsInfoBar_jni.h" |
| 12 |
| 13 InstantAppsInfoBar::InstantAppsInfoBar( |
| 14 std::unique_ptr<InstantAppsInfoBarDelegate> delegate) |
| 15 : ConfirmInfoBar(std::move(delegate)) {} |
| 16 |
| 17 InstantAppsInfoBar::~InstantAppsInfoBar() {} |
| 18 |
| 19 base::android::ScopedJavaLocalRef<jobject> |
| 20 InstantAppsInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
| 21 InstantAppsInfoBarDelegate* delegate = |
| 22 static_cast<InstantAppsInfoBarDelegate*>(GetDelegate()); |
| 23 base::android::ScopedJavaLocalRef<jobject> infobar; |
| 24 infobar.Reset(Java_InstantAppsInfoBar_create(env, delegate->data().obj())); |
| 25 |
| 26 java_infobar_.Reset(env, infobar.obj()); |
| 27 return infobar; |
| 28 } |
OLD | NEW |