| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.vr_shell; | 5 package org.chromium.chrome.browser.vr_shell; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.graphics.Canvas; | 8 import android.graphics.Canvas; |
| 9 import android.graphics.Point; | 9 import android.graphics.Point; |
| 10 import android.os.StrictMode; | 10 import android.os.StrictMode; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // a way to compute good values for any screen size/scaling ratio. | 62 // a way to compute good values for any screen size/scaling ratio. |
| 63 | 63 |
| 64 // Increasing DPR any more than this doesn't appear to increase text quality
. | 64 // Increasing DPR any more than this doesn't appear to increase text quality
. |
| 65 private static final float DEFAULT_DPR = 1.2f; | 65 private static final float DEFAULT_DPR = 1.2f; |
| 66 // For WebVR we just create a DPR 1.0 display that matches the physical disp
lay size. | 66 // For WebVR we just create a DPR 1.0 display that matches the physical disp
lay size. |
| 67 private static final float WEBVR_DPR = 1.0f; | 67 private static final float WEBVR_DPR = 1.0f; |
| 68 // Fairly arbitrary values that put a good amount of content on the screen w
ithout making the | 68 // Fairly arbitrary values that put a good amount of content on the screen w
ithout making the |
| 69 // text too small to read. | 69 // text too small to read. |
| 70 private static final float DEFAULT_CONTENT_WIDTH = 960f; | 70 private static final float DEFAULT_CONTENT_WIDTH = 960f; |
| 71 private static final float DEFAULT_CONTENT_HEIGHT = 640f; | 71 private static final float DEFAULT_CONTENT_HEIGHT = 640f; |
| 72 // Make full screen 16:9 while maintaining same width as default. | 72 |
| 73 private static final float FULLSCREEN_CONTENT_WIDTH = 960f; | 73 // Make full screen 16:9 until we get exact dimensions from playing video. |
| 74 private static final float FULLSCREEN_CONTENT_HEIGHT = 540f; | 74 private static final float FULLSCREEN_CONTENT_WIDTH = 1024f; |
| 75 private static final float FULLSCREEN_CONTENT_HEIGHT = 576f; |
| 75 | 76 |
| 76 private final ChromeActivity mActivity; | 77 private final ChromeActivity mActivity; |
| 77 private final VrShellDelegate mDelegate; | 78 private final VrShellDelegate mDelegate; |
| 78 private final VirtualDisplayAndroid mContentVirtualDisplay; | 79 private final VirtualDisplayAndroid mContentVirtualDisplay; |
| 79 private final TabRedirectHandler mTabRedirectHandler; | 80 private final TabRedirectHandler mTabRedirectHandler; |
| 80 private final TabObserver mTabObserver; | 81 private final TabObserver mTabObserver; |
| 81 private final TabModelSelectorObserver mTabModelSelectorObserver; | 82 private final TabModelSelectorObserver mTabModelSelectorObserver; |
| 82 private final View.OnTouchListener mTouchListener; | 83 private final View.OnTouchListener mTouchListener; |
| 83 private TabModelSelectorTabObserver mTabModelSelectorTabObserver; | 84 private TabModelSelectorTabObserver mTabModelSelectorTabObserver; |
| 84 | 85 |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab
s, | 619 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab
s, |
| 619 Tab[] incognitoTabs); | 620 Tab[] incognitoTabs); |
| 620 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito
, int id, | 621 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito
, int id, |
| 621 String title); | 622 String title); |
| 622 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito
, int id); | 623 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito
, int id); |
| 623 private native Surface nativeTakeContentSurface(long nativeVrShell); | 624 private native Surface nativeTakeContentSurface(long nativeVrShell); |
| 624 private native void nativeRestoreContentSurface(long nativeVrShell); | 625 private native void nativeRestoreContentSurface(long nativeVrShell); |
| 625 private native void nativeSetHistoryButtonsEnabled( | 626 private native void nativeSetHistoryButtonsEnabled( |
| 626 long nativeVrShell, boolean canGoBack, boolean canGoForward); | 627 long nativeVrShell, boolean canGoBack, boolean canGoForward); |
| 627 } | 628 } |
| OLD | NEW |