Commit 9a1c06f4 authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

VR: Remove unused code and fix presubmit warning

BUG=
R=mthiesse

Change-Id: I8c33393c152c7e092d494b8368e956fb2059c7b4
Reviewed-on: https://chromium-review.googlesource.com/937642
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539179}
parent 3fcf73e5
......@@ -29,7 +29,6 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.compositor.CompositorView;
import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
import org.chromium.chrome.browser.modaldialog.ModalDialogManager;
......@@ -46,7 +45,6 @@ import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.vr_shell.keyboard.VrInputMethodManagerWrapper;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
import org.chromium.chrome.browser.widget.newtab.NewTabButton;
......@@ -864,25 +862,6 @@ public class VrShellImpl
mDelegate.onExitVrRequestResult(shouldExit);
}
@CalledByNative
private void showTab(int id) {
Tab tab = mActivity.getTabModelSelector().getTabById(id);
if (tab == null) {
return;
}
int index = mActivity.getTabModelSelector().getModel(tab.isIncognito()).indexOf(tab);
if (index == TabModel.INVALID_TAB_INDEX) {
return;
}
TabModelUtils.setIndex(mActivity.getTabModelSelector().getModel(tab.isIncognito()), index);
}
@CalledByNative
private void openNewTab(boolean incognito) {
mActivity.getTabCreator(incognito).launchUrl(
UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI);
}
@CalledByNative
private void loadUrl(String url) {
if (mTab == null) {
......@@ -895,7 +874,6 @@ public class VrShellImpl
@VisibleForTesting
@Override
@CalledByNative
public void navigateForward() {
if (!mCanGoForward) return;
mActivity.getToolbarManager().forward();
......@@ -943,12 +921,6 @@ public class VrShellImpl
nativeSetHistoryButtonsEnabled(mNativeVrShell, mCanGoBack, mCanGoForward);
}
@CalledByNative
public void reload() {
if (mTab == null) return;
mTab.reload();
}
private float getNativePageScrollRatio() {
return mActivity.getWindowAndroid().getDisplay().getDipScale()
/ mContentVrWindowAndroid.getDisplay().getDipScale();
......
......@@ -289,8 +289,8 @@ void VrController::UpdateTouchInfo() {
}
std::unique_ptr<GestureList> VrController::DetectGestures() {
std::unique_ptr<GestureList> gesture_list = std::make_unique<GestureList>();
std::unique_ptr<blink::WebGestureEvent> gesture(new blink::WebGestureEvent());
auto gesture_list = std::make_unique<GestureList>();
auto gesture = std::make_unique<blink::WebGestureEvent>();
if (controller_state_->GetConnectionState() != gvr::kControllerConnected) {
gesture_list->push_back(std::move(gesture));
......
......@@ -629,41 +629,6 @@ void VrShell::ResumeContentRendering(JNIEnv* env,
gl_thread_->GetVrShellGl()));
}
// Note that the following code is obsolete and is here as reference for the
// actions that need to be implemented natively.
void VrShell::DoUiAction(const UiAction action,
const base::DictionaryValue* arguments) {
// Actions that can be handled natively.
switch (action) {
default:
break;
}
// Actions that are handled in java.
JNIEnv* env = base::android::AttachCurrentThread();
switch (action) {
case SHOW_TAB: {
int id;
CHECK(arguments->GetInteger("id", &id));
Java_VrShellImpl_showTab(env, j_vr_shell_, id);
return;
}
case OPEN_NEW_TAB: {
bool incognito;
CHECK(arguments->GetBoolean("incognito", &incognito));
Java_VrShellImpl_openNewTab(env, j_vr_shell_, incognito);
return;
}
case HISTORY_FORWARD:
Java_VrShellImpl_navigateForward(env, j_vr_shell_);
break;
case RELOAD:
Java_VrShellImpl_reload(env, j_vr_shell_);
break;
default:
NOTREACHED();
}
}
void VrShell::ContentWebContentsDestroyed() {
web_contents_ = nullptr;
}
......
......@@ -58,15 +58,6 @@ class VrShellDelegate;
class VrWebContentsObserver;
struct AutocompleteRequest;
enum UiAction {
HISTORY_BACK = 0,
HISTORY_FORWARD,
RELOAD,
SHOW_TAB,
OPEN_NEW_TAB,
EXIT_PRESENT,
};
// The native instance of the Java VrShell. This class is not threadsafe and
// must only be used on the UI thread.
class VrShell : device::GvrGamepadDataProvider,
......@@ -181,10 +172,6 @@ class VrShell : device::GvrGamepadDataProvider,
jint overlay_width,
jint overlay_height);
// Perform a UI action triggered by the javascript API.
void DoUiAction(const UiAction action,
const base::DictionaryValue* arguments);
void SetHighAccuracyLocation(bool high_accuracy_location);
void ForceExitVr();
......
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