Commit 62bf3786 authored by Colin Blundell's avatar Colin Blundell Committed by Chromium LUCI CQ

[WebLayer] Add version checks to recently-added Navigation APIs

Following sky@'s feedback on a similar API, this CL adds version checks
and proper javadoc comments to two APIs that were added on Navigation
in 89.

Bug: 1145983
Change-Id: I13f5171bd979829e28e9fea3915aa48048f1cfc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570373Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833309}
parent e8831883
...@@ -173,10 +173,15 @@ public class Navigation extends IClientNavigation.Stub { ...@@ -173,10 +173,15 @@ public class Navigation extends IClientNavigation.Stub {
* headers. This means the only time the embedder can know if the navigation resulted in an * headers. This means the only time the embedder can know if the navigation resulted in an
* external intent being launched is in NavigationCallback.onNavigationFailed. * external intent being launched is in NavigationCallback.onNavigationFailed.
* *
* @return Whether an intent was launched for the navigation.
*
* @since 89 * @since 89
*/ */
public boolean wasIntentLaunched() { public boolean wasIntentLaunched() {
ThreadCheck.ensureOnUiThread(); ThreadCheck.ensureOnUiThread();
if (WebLayer.getSupportedMajorVersionInternal() < 89) {
throw new UnsupportedOperationException();
}
try { try {
return mNavigationImpl.wasIntentLaunched(); return mNavigationImpl.wasIntentLaunched();
} catch (RemoteException e) { } catch (RemoteException e) {
...@@ -192,10 +197,15 @@ public class Navigation extends IClientNavigation.Stub { ...@@ -192,10 +197,15 @@ public class Navigation extends IClientNavigation.Stub {
* means the only time the embedder can know this status definitively is in * means the only time the embedder can know this status definitively is in
* NavigationCallback.onNavigationFailed. * NavigationCallback.onNavigationFailed.
* *
* @return Whether this navigation resulted in a user decision guarding external intent launch.
*
* @since 89 * @since 89
*/ */
public boolean isUserDecidingIntentLaunch() { public boolean isUserDecidingIntentLaunch() {
ThreadCheck.ensureOnUiThread(); ThreadCheck.ensureOnUiThread();
if (WebLayer.getSupportedMajorVersionInternal() < 89) {
throw new UnsupportedOperationException();
}
try { try {
return mNavigationImpl.isUserDecidingIntentLaunch(); return mNavigationImpl.isUserDecidingIntentLaunch();
} catch (RemoteException e) { } catch (RemoteException e) {
......
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