Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBarDelegate.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBarDelegate.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..06292828eba04c383587d3015c866b692c1d3f54 |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBarDelegate.java |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2014 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.CalledByNative; |
| +import org.chromium.chrome.browser.ResourceId; |
| +import org.chromium.content_public.browser.WebContents; |
| + |
| +/** |
| + * Provides JNI methods for DataReductionProxyInfoBars. |
| + */ |
| +public class DataReductionProxyInfoBarDelegate { |
| + public static void launch(WebContents webContents) { |
|
aruslan
2014/07/15 23:14:28
nit: javadoc. should it be accessible from outsid
bengr
2014/07/16 00:43:25
Done and done.
|
| + nativeLaunch(webContents); |
| + } |
| + |
| + private DataReductionProxyInfoBarDelegate() { |
| + } |
| + |
| + @CalledByNative |
| + public static DataReductionProxyInfoBarDelegate create() { |
| + return new DataReductionProxyInfoBarDelegate(); |
| + } |
| + |
| + /** |
| + * Creates and begins the process for showing a DataReductionProxyInfoBarDelegate. |
| + * @param nativeInfoBar Pointer to the C++ InfoBar corresponding to the Java InfoBar. |
| + * @param enumeratedIconId ID corresponding to the icon that will be shown for the InfoBar. |
| + * The ID must have been mapped using the ResourceMapper class before |
| + * passing it to this function. |
| + */ |
| + @CalledByNative |
| + InfoBar showDataReductionProxyInfoBar(long nativeInfoBar, int enumeratedIconId) { |
| + int drawableId = ResourceId.mapToDrawableId(enumeratedIconId); |
| + DataReductionProxyInfoBar infoBar = new DataReductionProxyInfoBar( |
| + nativeInfoBar, drawableId); |
| + return infoBar; |
| + } |
| + |
| + protected static native void nativeLaunch(WebContents webContents); |
| + |
|
aruslan
2014/07/15 23:14:28
nit: stray empty line
bengr
2014/07/16 00:43:25
Done.
|
| +} |