Fix a problem that the suggestion popup does not disappear when initiating navigation.

Steps to reproduce:
1. Type some keys in |mUrlTextView| to show some suggestions.
2. Press "Go" button.

What heppended:
The url loading starts but the suggestions does not disappear.

BUG=none

Review URL: https://codereview.chromium.org/312673007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274575 0039d316-1c4b-4281-b951-d872f2087c98
parent 288b44de
......@@ -47,6 +47,8 @@ public class ChromeShellToolbar extends LinearLayout {
private AppMenuHandler mMenuHandler;
private AppMenuButtonHelper mAppMenuButtonHelper;
private SuggestionPopup mSuggestionPopup;
/**
* @param context The Context the view is running in.
* @param attrs The attributes of the XML tag that is inflating the view.
......@@ -102,6 +104,7 @@ public class ChromeShellToolbar extends LinearLayout {
return false;
}
mSuggestionPopup.dismissPopup();
mTab.loadUrlWithSanitization(mUrlTextView.getText().toString());
mUrlTextView.clearFocus();
setKeyboardVisibilityForUrl(false);
......@@ -118,7 +121,9 @@ public class ChromeShellToolbar extends LinearLayout {
}
}
});
mUrlTextView.addTextChangedListener(new SuggestionPopup(getContext(), mUrlTextView, this));
mSuggestionPopup = new SuggestionPopup(getContext(), mUrlTextView, this);
mUrlTextView.addTextChangedListener(mSuggestionPopup);
}
private void initializeMenuButton() {
......
......@@ -61,7 +61,7 @@ public class SuggestionPopup implements OnSuggestionsReceivedListener, TextWatch
dismissPopup();
}
private void dismissPopup() {
public void dismissPopup() {
if (mSuggestionsPopup != null) {
mSuggestionsPopup.dismiss();
mSuggestionsPopup = null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment