backout cecf156d7869 because of talos fail
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 28 Mar 2012 16:18:16 -0700
changeset 93892 082d5e045cc2009c1b7709b85b2684925759e7d1
parent 93891 a8bebfa88961964c05f42c7035f305a6afdf2595
child 93893 dcf8929a8115a4a90e673f9dbf5c857857307445
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone14.0a1
backs outcecf156d786974f245ee8396c2c5074741e03462
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
backout cecf156d7869 because of talos fail
mobile/android/base/DoorHanger.java
mobile/android/base/resources/layout/doorhanger.xml
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/DoorHanger.java
+++ b/mobile/android/base/DoorHanger.java
@@ -38,41 +38,34 @@
 
 package org.mozilla.gecko;
 
 import android.content.Context;
 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;
 
 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;
     static private LayoutParams mLayoutParams;
     public Tab mTab;
     // 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;
     private long mTimeout = 0;
 
     public DoorHanger(Context aContext, String aValue) {
         super(aContext);
 
@@ -101,28 +94,17 @@ public class DoorHanger extends LinearLa
         Button mButton = new Button(mContext);
         mButton.setText(aText);
         mButton.setTag(Integer.toString(aCallback));
         mButton.setOnClickListener(this);
         mChoicesLayout.addView(mButton, mLayoutParams);
     }
 
     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);
 
         // This will hide the doorhanger (and hide the popup if there are no
         // more doorhangers to show)
         GeckoApp.mDoorHangerPopup.updatePopup();
     }
 
@@ -179,23 +161,16 @@ public class DoorHanger extends LinearLa
             // prevent text outside the link from flashing when clicked
             ForegroundColorSpan colorSpan = new ForegroundColorSpan(mTextView.getCurrentTextColor());
             titleWithLink.setSpan(colorSpan, 0, title.length(), 0);
 
             titleWithLink.setSpan(linkSpan, title.length() + 1, titleWithLink.length(), 0);
             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
     // it's okay to remove a doorhanger.
     public boolean shouldRemove() {
         // If persistence is set to -1, the doorhanger will never be
         // automatically removed.
         if (mPersistence != 0) {
--- a/mobile/android/base/resources/layout/doorhanger.xml
+++ b/mobile/android/base/resources/layout/doorhanger.xml
@@ -4,21 +4,15 @@
     <TextView android:id="@+id/doorhanger_title"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:textAppearance="?android:attr/textAppearanceMedium"
               android:textColor="?android:attr/textColorPrimary"
               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"
                   android:layout_height="wrap_content"
                   android:orientation="horizontal"/>
 
 </merge>
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1069,25 +1069,20 @@ var NativeWindow = {
     }
   },
 
   observe: function(aSubject, aTopic, aData) {
     if (aTopic == "Menu:Clicked") {
       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];
           }
         }
       }
     }
   },