Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / chrome / android / java / src / org / chromium / chrome / browser / infobar / GeneratedPasswordSavedInfoBarDelegate.java
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.infobar;
6
7 import org.chromium.base.CalledByNative;
8 import org.chromium.chrome.browser.ResourceId;
9
10 /**
11  * Provides JNI methods for the infobar to notify that the generated password was saved.
12  */
13 public class GeneratedPasswordSavedInfoBarDelegate {
14     /**
15      * Creates and shows the infobar to notify that the generated password was saved.
16      * @param nativeInfoBar Pointer to the native infobar.
17      * @param enumeratedIconId Enum ID corresponding to the icon that the infobar will show.
18      * @param messageText Message to display in the infobar.
19      * @param inlineLinkRangeStart The start of the range of the messageText that should be a link.
20      * @param inlineLinkRangeEnd The end of the range of the messageText that should be a link.
21      * @param buttonLabel String to display on the button.
22      */
23     @CalledByNative
24     private static InfoBar show(long nativeInfoBar, int enumeratedIconId, String messageText,
25             int inlineLinkRangeStart, int inlineLinkRangeEnd, String buttonLabel) {
26         return new GeneratedPasswordSavedInfoBar(nativeInfoBar,
27                 ResourceId.mapToDrawableId(enumeratedIconId), messageText, inlineLinkRangeStart,
28                 inlineLinkRangeEnd, buttonLabel);
29     }
30 }