X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fandroid%2Fjava%2Fsrc%2Forg%2Fchromium%2Fchrome%2Fbrowser%2Finfobar%2FMessageInfoBar.java;h=941f0e253463246432765259991a5e0e4a412bc4;hb=490a4587e7e356282cb1453efaf36de4acc9762f;hp=20c3aeaf0f6c0e7652e229ae0ded6ec53e95e259;hpb=3a51af92707b9c600d06a404c9db8f07fcd50959;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java b/src/chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java index 20c3aea..941f0e2 100644 --- a/src/chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java +++ b/src/chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java @@ -4,66 +4,33 @@ package org.chromium.chrome.browser.infobar; -import android.content.Context; - -import org.chromium.chrome.R; /** * A simple infobar that contains a message and a close icon on the right side. * This is used only in the context of Java code and is not associated with any native * InfoBarDelegate. + * + * TODO(newt): merge this into InfoBar.java */ public class MessageInfoBar extends InfoBar { - private final CharSequence mTitle; /** - * Creates and returns an infobar with a white background and a close button on the right. + * Creates an infobar with a message and a close button. * @param title the text displayed in the infobar - * @return the infobar. */ - public static MessageInfoBar createInfoBar(CharSequence title) { - return new MessageInfoBar(null, 0, title, BACKGROUND_TYPE_INFO); + public MessageInfoBar(CharSequence title) { + this(null, 0, title); } /** - * Creates and returns an infobar with a white background and a close button on the right. - * @param iconResourceId the icon shown on the right - * @param title the text displayed in the infobar - * @return the infobar. + * Creates an infobar with an icon, a message and a close button. + * @param listener A listener to be notified when the infobar is dismissed, or null. + * @param iconResourceId The icon to display in the infobar, or 0 if no icon should be shown. + * @param title The text to display in the infobar. */ - public static MessageInfoBar createInfoBar(int iconResourceId, CharSequence title) { - return new MessageInfoBar(null, iconResourceId, title, BACKGROUND_TYPE_INFO); - } - - /** - * Creates a warning infobar, with a yellow background and a warning icon on the right. - * @param title the text displayed in the infobar - * @return the infobar. - */ - public static MessageInfoBar createWarningInfoBar(CharSequence title) { - return createWarningInfoBar(null, title); - } - - /** - * Creates a warning infobar, with a yellow background and a warning icon on the right. - * @param listener an infobar dismissed listener - * @param title the text displayed in the infobar - * @return the infobar. - */ - public static MessageInfoBar createWarningInfoBar(InfoBarListeners.Dismiss listener, + public MessageInfoBar(InfoBarListeners.Dismiss listener, int iconResourceId, CharSequence title) { - return new MessageInfoBar(listener, R.drawable.warning, title, BACKGROUND_TYPE_WARNING); - } - - protected MessageInfoBar(InfoBarListeners.Dismiss listener, int iconResourceId, - CharSequence title, int backgroundType) { - super(listener, backgroundType, iconResourceId); - mTitle = title; - } - - @Override - public CharSequence getMessageText(Context context) { - return mTitle; + super(listener, iconResourceId, title); } @Override