| Index: chrome/browser/ui/android/infobars/tabbed_mode_opt_in_infobar_delegate.h
|
| diff --git a/chrome/browser/ui/android/infobars/tabbed_mode_opt_in_infobar_delegate.h b/chrome/browser/ui/android/infobars/tabbed_mode_opt_in_infobar_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c525d71924f15d027f51a8e9a6513a652d9fd180
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/android/infobars/tabbed_mode_opt_in_infobar_delegate.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_TABBED_MODE_OPT_IN_INFOBAR_DELEGATE_H_
|
| +#define CHROME_BROWSER_UI_ANDROID_INFOBARS_TABBED_MODE_OPT_IN_INFOBAR_DELEGATE_H_
|
| +
|
| +#include <jni.h>
|
| +
|
| +#include "base/android/scoped_java_ref.h"
|
| +#include "base/macros.h"
|
| +#include "components/infobars/core/confirm_infobar_delegate.h"
|
| +
|
| +namespace content {
|
| +class WebContents;
|
| +}
|
| +
|
| +// An InfoBarDelegate that asks to opt-in tabbed mode for the devices that
|
| +// document mode is inconvenient.
|
| +class TabbedModeOptInInfoBarDelegate : public ConfirmInfoBarDelegate {
|
| + public:
|
| + static bool RegisterTabbedModeOptInInfoBarDelegate(JNIEnv* env);
|
| +
|
| + TabbedModeOptInInfoBarDelegate(JNIEnv* env, jobject obj);
|
| + ~TabbedModeOptInInfoBarDelegate() override;
|
| +
|
| + private:
|
| + // InfoBarDelegate:
|
| + int GetIconId() const override;
|
| + bool ShouldExpire(const NavigationDetails& details) const override;
|
| + void InfoBarDismissed() override;
|
| +
|
| + // ConfirmInfoBarDelegate:
|
| + base::string16 GetMessageText() const override;
|
| + int GetButtons() const override;
|
| + base::string16 GetButtonLabel(InfoBarButton button) const override;
|
| + bool Accept() override;
|
| + bool Cancel() override;
|
| +
|
| + base::android::ScopedJavaGlobalRef<jobject> j_delegate_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TabbedModeOptInInfoBarDelegate);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TABBED_MODE_OPT_IN_INFOBAR_DELEGATE_H_
|
|
|