Chromium Code Reviews| Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java |
| diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java |
| index eea08debaf2ab936bd76d120eeca1e906d798f32..24bb8ec65fff56ad58d9c16cb193a52d2c7c8298 100644 |
| --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java |
| +++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java |
| @@ -76,6 +76,7 @@ public class ChromeShellToolbar extends LinearLayout { |
| private ImageButton mAddButton; |
| private int mProgress = 0; |
| private boolean mLoading = true; |
| + private boolean mFocus = false; |
| /** |
| * @param context The Context the view is running in. |
| @@ -178,7 +179,8 @@ public class ChromeShellToolbar extends LinearLayout { |
| @Override |
| public void onFocusChange(View v, boolean hasFocus) { |
| setKeyboardVisibilityForUrl(hasFocus); |
| - mStopReloadButton.setVisibility(hasFocus ? GONE : VISIBLE); |
| + mFocus = hasFocus; |
| + updateToolBarButtonState(); |
| if (!hasFocus && mTab != null) { |
| mUrlTextView.setText(mTab.getWebContents().getUrl()); |
| mSuggestionPopup.dismissPopup(); |
| @@ -259,9 +261,10 @@ public class ChromeShellToolbar extends LinearLayout { |
| * Shows or hides the add and the stop/reload button . |
|
Bernhard Bauer
2015/02/12 11:49:11
Nit: remove the space before the period.
|
| * @param visibility The visibility status of the add button. |
|
Bernhard Bauer
2015/02/12 11:49:11
Javadoc comment is now outdated.
|
| */ |
| - public void showAddButton(boolean visibility) { |
| - mAddButton.setVisibility(visibility ? VISIBLE : GONE); |
| - mStopReloadButton.setVisibility(visibility ? GONE : VISIBLE); |
| + public void updateToolBarButtonState() { |
| + boolean tabSwitcherState = mTabManager.isTabSwitcherVisible(); |
| + mAddButton.setVisibility(tabSwitcherState ? VISIBLE : GONE); |
| + mStopReloadButton.setVisibility(tabSwitcherState || mFocus ? GONE : VISIBLE); |
| } |
| /** |