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

Unified Diff: content/shell/android/java/src/org/chromium/content_shell/Shell.java

Issue 287373002: Navigation buttons should not enable if user can not navigate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified code as suggested Created 6 years, 7 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: content/shell/android/java/src/org/chromium/content_shell/Shell.java
diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
index 9e01a9df7abfab800e63c719bd8899d005c53dec..42bcf099f86ae764255b944dc00d646088cf463d 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
@@ -161,6 +161,8 @@ public class Shell extends LinearLayout {
mPrevButton.setVisibility(hasFocus ? GONE : VISIBLE);
if (!hasFocus) {
mUrlTextView.setText(mContentViewCore.getUrl());
+ mPrevButton.setEnabled(mContentViewCore.canGoBack());
+ mNextButton.setEnabled(mContentViewCore.canGoForward());
}
}
});
@@ -226,7 +228,11 @@ public class Shell extends LinearLayout {
private void onLoadProgressChanged(double progress) {
removeCallbacks(mClearProgressRunnable);
mProgressDrawable.setLevel((int) (10000.0 * progress));
- if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
+ if (progress == 1.0) {
+ postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
+ mPrevButton.setEnabled(mContentViewCore.canGoBack());
Ted C 2014/05/20 22:29:37 In my previous comment, I meant that we should act
+ mNextButton.setEnabled(mContentViewCore.canGoForward());
+ }
}
@CalledByNative
« 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