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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java

Issue 2022313002: UI for the Data Saver InfoBar Promo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@infobarPromo
Patch Set: use app_icon Created 4 years, 6 months 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/android/java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..b3ea267aab8fb5f949f25fa179e7837503ef64c4
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java
@@ -0,0 +1,41 @@
+// Copyright 2016 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.
+
+package org.chromium.chrome.browser.infobar;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.content_public.browser.WebContents;
+
+/**
+ * Provides JNI methods for DataReductionPromoInfoBars.
+ */
+public class DataReductionPromoInfoBarDelegate {
+ /**
+ * Launches the {@link InfoBar}.
+ *
+ * @param webContents The {@link WebContents} in which to launch the {@link InfoBar}.
+ */
+ static void launch(WebContents webContents) {
+ nativeLaunch(webContents);
+ }
+
+ private DataReductionPromoInfoBarDelegate() {
Raj 2016/06/13 17:52:18 nit: may be empty constructor can be defined inlin
megjablon 2016/06/23 23:17:30 Inlining is an optimization performed by the Java
Raj 2016/06/25 01:21:10 Acknowledged.
+ }
+
+ @CalledByNative
+ public static DataReductionPromoInfoBarDelegate create() {
+ return new DataReductionPromoInfoBarDelegate();
+ }
+
+ /**
+ * Creates and begins the process for showing a DataReductionProxyInfoBarDelegate.
+ */
+ @CalledByNative
+ InfoBar showDataReductionPromoInfoBar() {
Raj 2016/06/13 17:52:18 /s/showDataReductionPromoInfoBar/showInfoBarPromo
megjablon 2016/06/23 23:17:30 Done.
+ DataReductionPromoInfoBar infoBar = new DataReductionPromoInfoBar();
+ return infoBar;
+ }
+
+ private static native void nativeLaunch(WebContents webContents);
+}

Powered by Google App Engine
This is Rietveld 408576698