Backed out changeset fcd1191c12b5 (Bug 996850)
authorChenxia Liu <liuche@mozilla.com>
Tue, 22 Apr 2014 11:33:57 -0700
changeset 180074 3f2032f4dad71d52d072310766c22ff0f99b69de
parent 180073 fcd1191c12b5cc2e875111836ce27e747eb8bcf4
child 180075 4c8ee55dbdd1e3b08e585ba7f2cab8ce44cd0bab
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs996850
milestone31.0a1
backs outfcd1191c12b5cc2e875111836ce27e747eb8bcf4
Backed out changeset fcd1191c12b5 (Bug 996850)
mobile/android/base/home/PinSiteDialog.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/strings.xml.in
--- a/mobile/android/base/home/PinSiteDialog.java
+++ b/mobile/android/base/home/PinSiteDialog.java
@@ -22,17 +22,16 @@ import android.text.TextWatcher;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.widget.AdapterView;
 import android.widget.EditText;
 import android.widget.ListView;
-import android.widget.Toast;
 
 /**
  * Dialog fragment that displays frecency search results, for pinning a site, in a GridView.
  */
 class PinSiteDialog extends DialogFragment {
     // Listener for url selection
     public static interface OnSiteSelectedListener {
         public void onSiteSelected(String url, String title);
@@ -105,26 +104,21 @@ class PinSiteDialog extends DialogFragme
             @Override
             public boolean onKey(View v, int keyCode, KeyEvent event) {
                 if (keyCode != KeyEvent.KEYCODE_ENTER || mOnSiteSelectedListener == null) {
                     return false;
                 }
 
                 // If the user manually entered a search term or URL, wrap the value in
                 // a special URI until we can get a valid URL for this bookmark.
-                final String text = mSearch.getText().toString().trim();
-                if (!TextUtils.isEmpty(text)) {
-                    final String url = TopSitesPanel.encodeUserEnteredUrl(text);
-                    mOnSiteSelectedListener.onSiteSelected(url, text);
-                    dismiss();
-                } else {
-                    // Can't have empty text.
-                    Toast.makeText(getActivity(), R.string.home_top_sites_edit_empty_toast, Toast.LENGTH_SHORT).show();;
-                }
+                final String text = mSearch.getText().toString();
+                final String url = TopSitesPanel.encodeUserEnteredUrl(text);
+                mOnSiteSelectedListener.onSiteSelected(url, text);
 
+                dismiss();
                 return true;
             }
         });
 
         mSearch.setOnFocusChangeListener(new View.OnFocusChangeListener() {
             @Override
             public void onFocusChange(View v, boolean hasFocus) {
                 if (hasFocus) {
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -314,17 +314,16 @@ size. -->
 <!ENTITY button_clear_data "Clear data">
 <!ENTITY button_set "Set">
 <!ENTITY button_clear "Clear">
 
 <!ENTITY home_top_sites_title "Top Sites">
 <!-- Localization note (home_top_sites_add): This string is used as placeholder
      text underneath empty thumbnails in the Top Sites page on about:home. -->
 <!ENTITY home_top_sites_add "Add a site">
-<!ENTITY home_top_sites_edit_empty_toast "Please select a site or enter a search term">
 
 <!ENTITY home_history_title "History">
 <!ENTITY home_bookmarks_empty "Bookmarks you save show up here.">
 <!ENTITY home_last_tabs_title "Tabs from last time">
 <!ENTITY home_last_tabs_open "Open all tabs from last time">
 <!ENTITY home_last_tabs_empty "Your recent tabs show up here.">
 <!ENTITY home_most_recent_title "Most recent">
 <!ENTITY home_most_recent_empty "Websites you visited most recently show up here.">
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -292,18 +292,16 @@
   <string name="button_clear_data">&button_clear_data;</string>
   <string name="button_set">&button_set;</string>
   <string name="button_clear">&button_clear;</string>
   <string name="button_yes">&button_yes;</string>
   <string name="button_no">&button_no;</string>
 
   <string name="home_top_sites_title">&home_top_sites_title;</string>
   <string name="home_top_sites_add">&home_top_sites_add;</string>
-  <string name="home_top_sites_edit_empty_toast">&home_top_sites_edit_empty_toast;</string>
-
   <string name="home_history_title">&home_history_title;</string>
   <string name="home_bookmarks_empty">&home_bookmarks_empty;</string>
   <string name="home_last_tabs_title">&home_last_tabs_title;</string>
   <string name="home_last_tabs_open">&home_last_tabs_open;</string>
   <string name="home_last_tabs_empty">&home_last_tabs_empty;</string>
   <string name="home_most_recent_title">&home_most_recent_title;</string>
   <string name="home_most_recent_empty">&home_most_recent_empty;</string>
   <string name="home_reading_list_empty">&home_reading_list_empty;</string>