backout cecf156d7869 because of talos fail

This commit is contained in:
Margaret Leibovic 2012-03-28 16:18:16 -07:00
parent fa35b699f7
commit a1f5e3dae5
3 changed files with 3 additions and 39 deletions

View File

@ -43,11 +43,9 @@ import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.text.style.URLSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -55,8 +53,6 @@ import org.json.JSONObject;
import org.json.JSONException;
public class DoorHanger extends LinearLayout implements Button.OnClickListener {
private static final String LOGTAG = "DoorHanger";
private Context mContext;
private LinearLayout mChoicesLayout;
private TextView mTextView;
@ -65,9 +61,6 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
// value used to identify the notification
private String mValue;
// Optional checkbox added underneath message text
private CheckBox mCheckBox;
static private LayoutInflater mInflater;
private int mPersistence = 0;
@ -106,18 +99,7 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
}
public void onClick(View v) {
JSONObject response = new JSONObject();
try {
response.put("callback", v.getTag().toString());
// If the checkbox is being used, pass its value
if (mCheckBox != null)
response.put("checked", mCheckBox.isChecked());
} catch (JSONException ex) {
Log.e(LOGTAG, "Error creating onClick response: " + ex);
}
GeckoEvent e = GeckoEvent.createBroadcastEvent("Doorhanger:Reply", response.toString());
GeckoEvent e = GeckoEvent.createBroadcastEvent("Doorhanger:Reply", v.getTag().toString());
GeckoAppShell.sendEventToGecko(e);
mTab.removeDoorHanger(mValue);
@ -184,13 +166,6 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
mTextView.setText(titleWithLink);
mTextView.setMovementMethod(LinkMovementMethod.getInstance());
} catch (JSONException e) { }
try {
String checkBoxText = options.getString("checkbox");
mCheckBox = (CheckBox) findViewById(R.id.doorhanger_checkbox);
mCheckBox.setText(checkBoxText);
mCheckBox.setVisibility(VISIBLE);
} catch (JSONException e) { }
}
// This method checks with persistence and timeout options to see if

View File

@ -9,12 +9,6 @@
android:textColorLink="@color/doorhanger_link"
android:padding="10dp"/>
<CheckBox android:id="@+id/doorhanger_checkbox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:checked="true"
android:visibility="gone"/>
<LinearLayout android:id="@+id/doorhanger_choices"
style="@android:style/ButtonBar"
android:layout_width="fill_parent"

View File

@ -1074,15 +1074,10 @@ var NativeWindow = {
if (this.menu._callbacks[aData])
this.menu._callbacks[aData]();
} else if (aTopic == "Doorhanger:Reply") {
let data = JSON.parse(aData);
let reply_id = data["callback"];
let reply_id = aData;
if (this.doorhanger._callbacks[reply_id]) {
// Pass the value of the optional checkbox to the callback
let checked = data["checked"];
this.doorhanger._callbacks[reply_id].cb(checked);
let prompt = this.doorhanger._callbacks[reply_id].prompt;
this.doorhanger._callbacks[reply_id].cb();
for (let id in this.doorhanger._callbacks) {
if (this.doorhanger._callbacks[id].prompt == prompt) {
delete this.doorhanger._callbacks[id];