1// Copyright 2013 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 5package org.chromium.chrome.browser.infobar; 6 7 8/** 9 * A simple infobar that contains a message and a close icon on the right side. 10 * This is used only in the context of Java code and is not associated with any native 11 * InfoBarDelegate. 12 * 13 * TODO(newt): merge this into InfoBar.java 14 */ 15public class MessageInfoBar extends InfoBar { 16 17 /** 18 * Creates an infobar with a message and a close button. 19 * @param title the text displayed in the infobar 20 */ 21 public MessageInfoBar(CharSequence title) { 22 this(null, 0, title); 23 } 24 25 /** 26 * Creates an infobar with an icon, a message and a close button. 27 * @param listener A listener to be notified when the infobar is dismissed, or null. 28 * @param iconResourceId The icon to display in the infobar, or 0 if no icon should be shown. 29 * @param title The text to display in the infobar. 30 */ 31 public MessageInfoBar(InfoBarListeners.Dismiss listener, int iconResourceId, 32 CharSequence title) { 33 super(listener, iconResourceId, title); 34 } 35 36 @Override 37 public void onCloseButtonClicked() { 38 super.dismissJavaOnlyInfoBar(); 39 } 40} 41