Chromium Code Reviews| 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); |
| +} |