OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_FULLSCREEN_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_FULLSCREEN_INFOBAR_DELEGATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 13 |
| 14 class InfoBarService; |
| 15 |
| 16 // Native part of FullscreenInfoBarDelegate.java. This class is responsible |
| 17 // for adding and removing the fullscreen infobar. |
| 18 class FullscreenInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 19 public: |
| 20 static bool RegisterFullscreenInfoBarDelegate(JNIEnv* env); |
| 21 |
| 22 FullscreenInfoBarDelegate(JNIEnv* env, jobject obj, base::string16 origin); |
| 23 ~FullscreenInfoBarDelegate() override; |
| 24 |
| 25 // Called to close the infobar. |
| 26 void CloseFullscreenInfoBar(JNIEnv* env, jobject obj, jobject tab); |
| 27 |
| 28 // ConfirmInfoBarDelegate: |
| 29 int GetIconID() const override; |
| 30 base::string16 GetMessageText() const override; |
| 31 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 32 bool Accept() override; |
| 33 bool Cancel() override; |
| 34 |
| 35 private: |
| 36 base::android::ScopedJavaGlobalRef<jobject> j_delegate_; |
| 37 base::string16 origin_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(FullscreenInfoBarDelegate); |
| 40 }; |
| 41 |
| 42 #endif // CHROME_BROWSER_ANDROID_FULLSCREEN_INFOBAR_DELEGATE_H_ |
OLD | NEW |