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 #ifndef CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/strings/string16.h" |
| 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 11 #include "components/infobars/core/infobar_delegate.h" |
| 12 |
| 13 class InfoBarService; |
| 14 |
| 15 class InstantAppsInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 16 public: |
| 17 ~InstantAppsInfoBarDelegate() override; |
| 18 |
| 19 static void Create(InfoBarService* infobar_service, |
| 20 jobject jdata); |
| 21 |
| 22 base::android::ScopedJavaGlobalRef<jobject> data() { return data_; } |
| 23 |
| 24 private: |
| 25 explicit InstantAppsInfoBarDelegate(jobject jdata); |
| 26 |
| 27 // ConfirmInfoBarDelegate: |
| 28 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 29 base::string16 GetMessageText() const override; |
| 30 bool Accept() override; |
| 31 bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; |
| 32 |
| 33 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
| 34 base::android::ScopedJavaGlobalRef<jobject> data_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(InstantAppsInfoBarDelegate); |
| 37 }; |
| 38 |
| 39 // Register native methods. |
| 40 bool RegisterInstantAppsInfoBarDelegate(JNIEnv* env); |
| 41 |
| 42 #endif // CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ |
OLD | NEW |