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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java

Issue 2735983004: Visually disable VR Shell back/forward buttons when no history is available (Closed)
Patch Set: Addressing closure compilation error Created 3 years, 9 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 | chrome/browser/android/vr_shell/ui_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
index 0a9b713d14b3e3fd4047691638b5360a4a1906d2..558c8bf9b752f4eddd51095ddc285ec3e09a2b56 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
@@ -204,6 +204,7 @@ public class VrShellImpl
} else {
nativeSwapContents(mNativeVrShell, null, mMotionEventSynthesizer);
}
+ updateHistoryButtonsVisibility();
}
@Override
@@ -558,11 +559,19 @@ public class VrShellImpl
@CalledByNative
public void navigateForward() {
mActivity.getToolbarManager().forward();
+ updateHistoryButtonsVisibility();
}
@CalledByNative
public void navigateBack() {
mActivity.getToolbarManager().back();
+ updateHistoryButtonsVisibility();
+ }
+
+ private void updateHistoryButtonsVisibility() {
+ boolean canGoBack = mTab != null && mTab.canGoBack();
+ boolean canGoForward = mTab != null && mTab.canGoForward();
+ nativeSetHistoryButtonsEnabled(mNativeVrShell, canGoBack, canGoForward);
}
@CalledByNative
@@ -619,4 +628,6 @@ public class VrShellImpl
private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito, int id);
private native Surface nativeTakeContentSurface(long nativeVrShell);
private native void nativeRestoreContentSurface(long nativeVrShell);
+ private native void nativeSetHistoryButtonsEnabled(
+ long nativeVrShell, boolean canGoBack, boolean canGoForward);
}
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698