| Index: chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.h
|
| diff --git a/chrome/browser/android/fullscreen/fullscreen_infobar_delegate.h b/chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.h
|
| similarity index 38%
|
| copy from chrome/browser/android/fullscreen/fullscreen_infobar_delegate.h
|
| copy to chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.h
|
| index 893e7f43b28326ae8049a3d2e776e05e03f3331a..ed9794bac1319c27bbff2318247e47fa83f3fdc5 100644
|
| --- a/chrome/browser/android/fullscreen/fullscreen_infobar_delegate.h
|
| +++ b/chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.h
|
| @@ -2,42 +2,44 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_ANDROID_FULLSCREEN_FULLSCREEN_INFOBAR_DELEGATE_H_
|
| -#define CHROME_BROWSER_ANDROID_FULLSCREEN_FULLSCREEN_INFOBAR_DELEGATE_H_
|
| +#ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_DOCUMENT_MODE_OPT_OUT_INFOBAR_DELEGATE_H_
|
| +#define CHROME_BROWSER_UI_ANDROID_INFOBARS_DOCUMENT_MODE_OPT_OUT_INFOBAR_DELEGATE_H_
|
|
|
| -#include <string>
|
| +#include <jni.h>
|
|
|
| -#include "base/android/jni_android.h"
|
| #include "base/android/scoped_java_ref.h"
|
| +#include "base/macros.h"
|
| #include "components/infobars/core/confirm_infobar_delegate.h"
|
| -#include "url/gurl.h"
|
|
|
| -class InfoBarService;
|
| +namespace content {
|
| +class WebContents;
|
| +}
|
|
|
| -// Native part of FullscreenInfoBarDelegate.java. This class is responsible
|
| -// for adding and removing the fullscreen infobar.
|
| -class FullscreenInfoBarDelegate : public ConfirmInfoBarDelegate {
|
| +// An InfoBarDelegate that asks to opt-out document mode for the devices that
|
| +// document mode is inconvenient.
|
| +class DocumentModeOptOutInfoBarDelegate : public ConfirmInfoBarDelegate {
|
| public:
|
| - static bool RegisterFullscreenInfoBarDelegate(JNIEnv* env);
|
| + static bool RegisterDocumentModeOptOutInfoBarDelegate(JNIEnv* env);
|
|
|
| - FullscreenInfoBarDelegate(JNIEnv* env, jobject obj, GURL origin);
|
| - ~FullscreenInfoBarDelegate() override;
|
| + DocumentModeOptOutInfoBarDelegate(JNIEnv* env, jobject obj);
|
| + ~DocumentModeOptOutInfoBarDelegate() override;
|
|
|
| - // Called to close the infobar.
|
| - void CloseFullscreenInfoBar(JNIEnv* env, jobject obj);
|
| + private:
|
| + // InfoBarDelegate:
|
| + int GetIconId() const override;
|
| + bool ShouldExpire(const NavigationDetails& details) const override;
|
| + void InfoBarDismissed() override;
|
|
|
| // ConfirmInfoBarDelegate:
|
| - int GetIconId() const override;
|
| base::string16 GetMessageText() const override;
|
| + int GetButtons() const override;
|
| base::string16 GetButtonLabel(InfoBarButton button) const override;
|
| bool Accept() override;
|
| bool Cancel() override;
|
|
|
| - private:
|
| base::android::ScopedJavaGlobalRef<jobject> j_delegate_;
|
| - GURL origin_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(FullscreenInfoBarDelegate);
|
| + DISALLOW_COPY_AND_ASSIGN(DocumentModeOptOutInfoBarDelegate);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_ANDROID_FULLSCREEN_FULLSCREEN_INFOBAR_DELEGATE_H_
|
| +#endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_DOCUMENT_MODE_OPT_OUT_INFOBAR_DELEGATE_H_
|
|
|