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

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

Issue 686673002: Correcting suggestion popup width on orientation change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correcting suggestion popup width Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.shell.omnibox; 5 package org.chromium.chrome.shell.omnibox;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.Rect; 8 import android.graphics.Rect;
9 import android.os.Handler; 9 import android.os.Handler;
10 import android.text.Editable; 10 import android.text.Editable;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 public SuggestionPopup(Context context, EditText urlField, ChromeShellToolba r toolbar) { 52 public SuggestionPopup(Context context, EditText urlField, ChromeShellToolba r toolbar) {
53 mContext = context; 53 mContext = context;
54 mUrlField = urlField; 54 mUrlField = urlField;
55 mToolbar = toolbar; 55 mToolbar = toolbar;
56 mAutocomplete = new AutocompleteController(this); 56 mAutocomplete = new AutocompleteController(this);
57 OnLayoutChangeListener listener = new OnLayoutChangeListener() { 57 OnLayoutChangeListener listener = new OnLayoutChangeListener() {
58 @Override 58 @Override
59 public void onLayoutChange(View v, int left, int top, int right, int bottom, 59 public void onLayoutChange(View v, int left, int top, int right, int bottom,
60 int oldLeft, int oldTop, int oldRight, int oldBottom) { 60 int oldLeft, int oldTop, int oldRight, int oldBottom) {
61 if (mSuggestionsPopup == null || !mSuggestionsPopup.isShowing()) return; 61 if (mSuggestionsPopup == null || !mSuggestionsPopup.isShowing()) return;
62 mSuggestionsPopup.setWidth(mUrlField.getWidth()); 62 mSuggestionsPopup.setWidth(mToolbar.getWidth());
63 mSuggestionsPopup.setHeight(getSuggestionPopupHeight()); 63 mSuggestionsPopup.setHeight(getSuggestionPopupHeight());
64 mSuggestionsPopup.show(); 64 mSuggestionsPopup.show();
65 } 65 }
66 }; 66 };
67 mUrlField.addOnLayoutChangeListener(listener); 67 mUrlField.addOnLayoutChangeListener(listener);
68 } 68 }
69 69
70 private void navigateToSuggestion(int position) { 70 private void navigateToSuggestion(int position) {
71 mToolbar.getCurrentTab().loadUrlWithSanitization( 71 mToolbar.getCurrentTab().loadUrlWithSanitization(
72 mSuggestionArrayAdapter.getItem(position).getUrl()); 72 mSuggestionArrayAdapter.getItem(position).getUrl());
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 @Override 187 @Override
188 public void beforeTextChanged(CharSequence s, int start, int count, int afte r) { 188 public void beforeTextChanged(CharSequence s, int start, int count, int afte r) {
189 mRequestSuggestions = null; 189 mRequestSuggestions = null;
190 } 190 }
191 191
192 @Override 192 @Override
193 public void onTextChanged(CharSequence s, int start, int before, int count) { 193 public void onTextChanged(CharSequence s, int start, int before, int count) {
194 } 194 }
195 } 195 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698