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

Unified Diff: chrome/browser/ui/android/infobars/tabbed_mode_opt_in_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: removed isOptedInToDocumentMode 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/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..526ae3b51741f9ace801bf45e6248f4f976fde97
--- /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 InfoBar delegate that asks to opt in tabbed mode for the devices that
gone 2015/11/17 23:18:16 nits: InfoBarDelegate. opt-in. Finish the senten
Kibeom Kim (inactive) 2015/11/20 11:44:15 Done.
+// 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_

Powered by Google App Engine
This is Rietveld 408576698