Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java

Issue 557263002: Adding option to move suggestion popup item text to omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified code as per review comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java
index fe1be4c7f3550aa16480591960379a3189473b1e..2afc267b8a180da4b1a5a162c5bf55f62158d927 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java
@@ -14,9 +14,10 @@ import android.view.View;
import android.view.View.OnLayoutChangeListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.EditText;
import android.widget.ListPopupWindow;
import android.widget.PopupWindow.OnDismissListener;
-import android.widget.TextView;
+
import org.chromium.chrome.browser.omnibox.AutocompleteController;
import org.chromium.chrome.browser.omnibox.AutocompleteController.OnSuggestionsReceivedListener;
@@ -34,7 +35,7 @@ public class SuggestionPopup implements OnSuggestionsReceivedListener, TextWatch
private static final long SUGGESTION_START_DELAY_MS = 30;
private final Context mContext;
- private final TextView mUrlField;
+ private final EditText mUrlField;
private final ChromeShellToolbar mToolbar;
private final AutocompleteController mAutocomplete;
@@ -48,7 +49,7 @@ public class SuggestionPopup implements OnSuggestionsReceivedListener, TextWatch
* Initializes a suggestion popup that will track urlField value and display suggestions based
* on that value.
*/
- public SuggestionPopup(Context context, TextView urlField,
+ public SuggestionPopup(Context context, EditText urlField,
ChromeShellToolbar toolbar) {
mContext = context;
mUrlField = urlField;
@@ -139,7 +140,8 @@ public class SuggestionPopup implements OnSuggestionsReceivedListener, TextWatch
mSuggestionsPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
mSuggestionsPopup.setWidth(mUrlField.getWidth());
mSuggestionArrayAdapter =
- new SuggestionArrayAdapter(mContext, R.layout.dropdown_item, suggestions);
+ new SuggestionArrayAdapter(mContext, R.layout.dropdown_item, suggestions,
+ mUrlField);
mSuggestionsPopup.setHeight(getSuggestionPopupHeight());
mSuggestionsPopup.setAdapter(mSuggestionArrayAdapter);
mSuggestionsPopup.setAnchorView(mUrlField);

Powered by Google App Engine
This is Rietveld 408576698