Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2389)

Unified Diff: chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.h

Issue 1435263003: [Android] Show document mode opt-out InfoBar on selected devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments, renaming Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/browser/android/resource_id.h ('k') | chrome/browser/ui/android/infobars/document_mode_opt_out_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698