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

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

Issue 914933002: Stop/reload button should hide if url bar is focussed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review changes Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7c914de6c9ea1b04e6de02259707506ae134598e 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;
+ updateStopReloadButtonState(hasFocus);
if (!hasFocus && mTab != null) {
mUrlTextView.setText(mTab.getWebContents().getUrl());
mSuggestionPopup.dismissPopup();
@@ -256,12 +258,20 @@ public class ChromeShellToolbar extends LinearLayout {
}
/**
- * Shows or hides the add and the stop/reload button .
+ * Shows or hides the add button .
* @param visibility The visibility status of the add button.
*/
public void showAddButton(boolean visibility) {
mAddButton.setVisibility(visibility ? VISIBLE : GONE);
- mStopReloadButton.setVisibility(visibility ? GONE : VISIBLE);
+ updateStopReloadButtonState(visibility);
+ }
+
+ /**
+ * Shows or hides the stop/reload button .
+ * @param visibility The visibility status of the stop/reload button.
Bernhard Bauer 2015/02/12 09:55:09 This parameter doesn't really control the visibili
+ */
+ public void updateStopReloadButtonState(boolean visibility) {
+ mStopReloadButton.setVisibility(mFocus || visibility ? GONE : VISIBLE);
}
/**
« 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