Back out e8fae7f2ce39 (bug 781318) because of reftest failure
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 15 Aug 2012 19:48:31 -0400
changeset 102488 12d306fa30d5c0674a473c0fabb0590ae6c86e68
parent 102487 82dba0cf6958757d2b1dc356744ed1d5e32c1f4a
child 102489 01a3cbde459cb95f5404523010c16571b3fc52f2
push id23288
push useremorley@mozilla.com
push dateThu, 16 Aug 2012 13:14:48 +0000
treeherdermozilla-central@3940df6f9356 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs781318
milestone17.0a1
backs oute8fae7f2ce393c292cdb906a1d2b7f15cc8828da
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
Back out e8fae7f2ce39 (bug 781318) because of reftest failure
mobile/android/base/PromptService.java
mobile/android/components/PromptService.js
--- a/mobile/android/base/PromptService.java
+++ b/mobile/android/base/PromptService.java
@@ -31,17 +31,16 @@ import android.widget.AdapterView.OnItem
 import android.widget.ArrayAdapter;
 import android.widget.CheckBox;
 import android.widget.CheckedTextView;
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.Spinner;
 import android.widget.TextView;
-import android.view.inputmethod.InputMethodManager;
 
 import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.TimeUnit;
 
 public class PromptService implements OnClickListener, OnCancelListener, OnItemClickListener, GeckoEventResponder {
     private static final String LOGTAG = "GeckoPromptService";
 
     private PromptInput[] mInputs;
@@ -79,34 +78,30 @@ public class PromptService implements On
             } catch(Exception ex) { }
         }
     }
 
     private class PromptInput {
         private String label = "";
         private String type  = "";
         private String hint  = "";
-        private Boolean autofocus = false;
         private JSONObject mJSONInput = null;
         private View view = null;
 
         public PromptInput(JSONObject aJSONInput) {
             mJSONInput = aJSONInput;
             try {
                 label = aJSONInput.getString("label");
             } catch(Exception ex) { }
             try {
                 type  = aJSONInput.getString("type");
             } catch(Exception ex) { }
             try {
                 hint  = aJSONInput.getString("hint");
             } catch(Exception ex) { }
-            try {
-                autofocus  = aJSONInput.getBoolean("autofocus");
-            } catch(Exception ex) { }
         }
 
         public View getView() {
             if (type.equals("checkbox")) {
                 CheckBox checkbox = new CheckBox(GeckoApp.mAppContext);
                 checkbox.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
                 checkbox.setText(label);
                 try {
@@ -125,28 +120,16 @@ public class PromptService implements On
                 try {
                     String value = mJSONInput.getString("value");
                     input.setText(value);
                 } catch(Exception ex) { }
 
                 if (!hint.equals("")) {
                     input.setHint(hint);
                 }
-
-                if (autofocus) {
-                    input.setOnFocusChangeListener(new View.OnFocusChangeListener() {
-                        public void onFocusChange(View v, boolean hasFocus) {
-                            if (hasFocus) {
-                                ((InputMethodManager) GeckoApp.mAppContext.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(v, 0);
-                            }
-                        }
-                    });
-                    input.requestFocus();
-                }
-
                 view = (View)input;
             } else if (type.equals("menulist")) {
                 Spinner spinner = new Spinner(GeckoApp.mAppContext);
                 try {
                     String[] listitems = getStringArray(mJSONInput, "values");
                     if (listitems.length > 0) {
                         ArrayAdapter<String> adapter = new ArrayAdapter<String>(GeckoApp.mAppContext, android.R.layout.simple_dropdown_item_1line, listitems);
                         spinner.setAdapter(adapter);
--- a/mobile/android/components/PromptService.js
+++ b/mobile/android/components/PromptService.js
@@ -243,43 +243,43 @@ Prompt.prototype = {
     }
 
     let data = this.commonPrompt(aTitle, aText, buttons, aCheckMsg, aCheckState, []);
     aCheckState.value = data.checkbox == "true";
     return data.button;
   },
 
   nsIPrompt_prompt: function nsIPrompt_prompt(aTitle, aText, aValue, aCheckMsg, aCheckState) {
-    let inputs = [{ type: "textbox", value: aValue.value, autofocus: true }];
+    let inputs = [{ type: "textbox", value: aValue.value }];
     let data = this.commonPrompt(aTitle, aText, null, aCheckMsg, aCheckState, inputs);
 
     let ok = data.button == 0;
     if (aCheckMsg)
       aCheckState.value = data.checkbox == "true";
     if (ok)
       aValue.value = data.textbox;
     return ok;
   },
 
   nsIPrompt_promptPassword: function nsIPrompt_promptPassword(
       aTitle, aText, aPassword, aCheckMsg, aCheckState) {
-    let inputs = [{ type: "password", hint: PromptUtils.getLocaleString("password", "passwdmgr"), value: aPassword.value || "", autofocus: true }];
+    let inputs = [{ type: "password", hint: PromptUtils.getLocaleString("password", "passwdmgr"), value: aPassword.value || "" }];
     let data = this.commonPrompt(aTitle, aText, null, aCheckMsg, aCheckState, inputs);
 
     let ok = data.button == 0;
     if (aCheckMsg)
       aCheckState.value = data.checkbox == "true";
     if (ok)
       aPassword.value = data.password;
     return ok;
   },
 
   nsIPrompt_promptUsernameAndPassword: function nsIPrompt_promptUsernameAndPassword(
       aTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-    let inputs = [{ type: "textbox",  hint: PromptUtils.getLocaleString("username", "passwdmgr"), value: aUsername.value, autofocus: true },
+    let inputs = [{ type: "textbox",  hint: PromptUtils.getLocaleString("username", "passwdmgr"), value: aUsername.value },
                   { type: "password", hint: PromptUtils.getLocaleString("password", "passwdmgr"), value: aPassword.value }];
     let data = this.commonPrompt(aTitle, aText, null, aCheckMsg, aCheckState, inputs);
 
     let ok = data.button == 0;
     if (aCheckMsg)
       aCheckState.value = data.checkbox == "true";
     if (ok) {
       aUsername.value = data.textbox;