This source file includes following definitions.
- createContent
- setControlsEnabled
package org.chromium.chrome.browser.infobar;
import android.content.Context;
import android.widget.Button;
import org.chromium.chrome.R;
public abstract class TwoButtonInfoBar extends InfoBar {
public TwoButtonInfoBar(InfoBarListeners.Dismiss dismissListener, int backgroundType,
int iconDrawableId) {
super(dismissListener, backgroundType, iconDrawableId);
}
@Override
public void createContent(InfoBarLayout layout) {
Context context = layout.getContext();
layout.addButtons(getPrimaryButtonText(context), getSecondaryButtonText(context));
}
@Override
public void setControlsEnabled(boolean state) {
super.setControlsEnabled(state);
ContentWrapperView wrapper = getContentWrapper(false);
if (wrapper != null) {
Button primary = (Button) wrapper.findViewById(R.id.button_primary);
Button secondary = (Button) wrapper.findViewById(R.id.button_secondary);
if (primary != null) primary.setEnabled(state);
if (secondary != null) secondary.setEnabled(state);
}
}
}