| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // a way to compute good values for any screen size/scaling ratio. | 61 // a way to compute good values for any screen size/scaling ratio. |
| 62 | 62 |
| 63 // Increasing DPR any more than this doesn't appear to increase text quality
. | 63 // Increasing DPR any more than this doesn't appear to increase text quality
. |
| 64 private static final float DEFAULT_DPR = 1.2f; | 64 private static final float DEFAULT_DPR = 1.2f; |
| 65 // For WebVR we just create a DPR 1.0 display that matches the physical disp
lay size. | 65 // For WebVR we just create a DPR 1.0 display that matches the physical disp
lay size. |
| 66 private static final float WEBVR_DPR = 1.0f; | 66 private static final float WEBVR_DPR = 1.0f; |
| 67 // Fairly arbitrary values that put a good amount of content on the screen w
ithout making the | 67 // Fairly arbitrary values that put a good amount of content on the screen w
ithout making the |
| 68 // text too small to read. | 68 // text too small to read. |
| 69 private static final float DEFAULT_CONTENT_WIDTH = 960f; | 69 private static final float DEFAULT_CONTENT_WIDTH = 960f; |
| 70 private static final float DEFAULT_CONTENT_HEIGHT = 640f; | 70 private static final float DEFAULT_CONTENT_HEIGHT = 640f; |
| 71 // Make full screen 16:9 while maintaining same width as default. | 71 |
| 72 private static final float FULLSCREEN_CONTENT_WIDTH = 960f; | 72 // Make full screen 16:9 until we get exact dimensions from playing video. |
| 73 private static final float FULLSCREEN_CONTENT_HEIGHT = 540f; | 73 private static final float FULLSCREEN_CONTENT_WIDTH = 1024f; |
| 74 private static final float FULLSCREEN_CONTENT_HEIGHT = 576f; |
| 74 | 75 |
| 75 private final ChromeActivity mActivity; | 76 private final ChromeActivity mActivity; |
| 76 private final VrShellDelegate mDelegate; | 77 private final VrShellDelegate mDelegate; |
| 77 private final VirtualDisplayAndroid mContentVirtualDisplay; | 78 private final VirtualDisplayAndroid mContentVirtualDisplay; |
| 78 private final TabRedirectHandler mTabRedirectHandler; | 79 private final TabRedirectHandler mTabRedirectHandler; |
| 79 private final TabObserver mTabObserver; | 80 private final TabObserver mTabObserver; |
| 80 private final TabModelSelectorObserver mTabModelSelectorObserver; | 81 private final TabModelSelectorObserver mTabModelSelectorObserver; |
| 81 private final View.OnTouchListener mTouchListener; | 82 private final View.OnTouchListener mTouchListener; |
| 82 private TabModelSelectorTabObserver mTabModelSelectorTabObserver; | 83 private TabModelSelectorTabObserver mTabModelSelectorTabObserver; |
| 83 | 84 |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab
s, | 629 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab
s, |
| 629 Tab[] incognitoTabs); | 630 Tab[] incognitoTabs); |
| 630 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito
, int id, | 631 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito
, int id, |
| 631 String title); | 632 String title); |
| 632 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito
, int id); | 633 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito
, int id); |
| 633 private native Surface nativeTakeContentSurface(long nativeVrShell); | 634 private native Surface nativeTakeContentSurface(long nativeVrShell); |
| 634 private native void nativeRestoreContentSurface(long nativeVrShell); | 635 private native void nativeRestoreContentSurface(long nativeVrShell); |
| 635 private native void nativeSetHistoryButtonsEnabled( | 636 private native void nativeSetHistoryButtonsEnabled( |
| 636 long nativeVrShell, boolean canGoBack, boolean canGoForward); | 637 long nativeVrShell, boolean canGoBack, boolean canGoForward); |
| 637 } | 638 } |
| OLD | NEW |