Commit 662f40fc authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

reland: weblayer: fixs enum conversions

These got lost in the rename.

BUG=none
TEST=none
TBR=jam@chromium.org

Change-Id: I0273dd26860950d0eb87215f84914d5c511205f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903758Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713563}
parent 13fe9c87
...@@ -9,6 +9,7 @@ import android.os.RemoteException; ...@@ -9,6 +9,7 @@ import android.os.RemoteException;
import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods; import org.chromium.base.annotations.NativeMethods;
import org.chromium.weblayer_private.interfaces.NewTabType;
/** /**
* Owns the c++ NewTabCallback class, which is responsible for forwarding all * Owns the c++ NewTabCallback class, which is responsible for forwarding all
...@@ -30,8 +31,24 @@ public final class NewTabCallbackProxy { ...@@ -30,8 +31,24 @@ public final class NewTabCallbackProxy {
mNativeNewTabCallbackProxy = 0; mNativeNewTabCallbackProxy = 0;
} }
@NewTabType
private static int implTypeToJavaType(@ImplNewTabType int type) {
switch (type) {
case ImplNewTabType.FOREGROUND:
return NewTabType.FOREGROUND_TAB;
case ImplNewTabType.BACKGROUND:
return NewTabType.BACKGROUND_TAB;
case ImplNewTabType.NEW_POPUP:
return NewTabType.NEW_POPUP;
case ImplNewTabType.NEW_WINDOW:
return NewTabType.NEW_WINDOW;
}
assert false;
return NewTabType.FOREGROUND_TAB;
}
@CalledByNative @CalledByNative
public void onNewTab(long nativeTab, int mode) throws RemoteException { public void onNewTab(long nativeTab, @ImplNewTabType int mode) throws RemoteException {
// This class should only be created while the tab is attached to a fragment. // This class should only be created while the tab is attached to a fragment.
assert mTab.getBrowser() != null; assert mTab.getBrowser() != null;
TabImpl tab = TabImpl tab =
......
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