| Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrProxyActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrProxyActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrProxyActivity.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2ff0826d4993426ed49bd37c77bf7042c2770a3a
|
| --- /dev/null
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrProxyActivity.java
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.chrome.browser.vr_shell;
|
| +
|
| +import android.app.Activity;
|
| +import android.content.Intent;
|
| +import android.os.Bundle;
|
| +
|
| +import org.chromium.base.Log;
|
| +
|
| +/**
|
| + * Dispatches incoming intents to the appropriate VR activity based on the VR intent extras.
|
| + */
|
| +public class VrProxyActivity extends Activity {
|
| + private static final String TAG = "VrProxyActivity";
|
| +
|
| + // The permission is required for listening for VR DON flow results.
|
| + private static final String PERMISSION_VR_ENTRY = "VR_ENTRY";
|
| +
|
| + @Override
|
| + public void onCreate(Bundle savedInstanceState) {
|
| + super.onCreate(savedInstanceState);
|
| + int target = getIntent().getIntExtra(VrShellDelegate.TARGET_EXTRA, -1);
|
| + if (target == -1) {
|
| + Log.e(TAG, "Failed to enter VR");
|
| + finish();
|
| + return;
|
| + }
|
| + Intent intent = new Intent(VrShellDelegate.VR_ENTRY_RESULT_ACTION);
|
| + intent.putExtra(VrShellDelegate.TARGET_EXTRA, target);
|
| + sendBroadcast(intent, getPackageName() + ".permission." + PERMISSION_VR_ENTRY);
|
| + finish();
|
| + }
|
| +}
|
|
|