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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
480 | 480 |
481 @Override | 481 @Override |
482 public void teardown() { | 482 public void teardown() { |
483 shutdown(); | 483 shutdown(); |
484 } | 484 } |
485 | 485 |
486 @Override | 486 @Override |
487 public void setWebVrModeEnabled(boolean enabled) { | 487 public void setWebVrModeEnabled(boolean enabled) { |
488 mContentVrWindowAndroid.setVSyncPaused(enabled); | 488 mContentVrWindowAndroid.setVSyncPaused(enabled); |
489 nativeSetWebVrMode(mNativeVrShell, enabled); | 489 nativeSetWebVrMode(mNativeVrShell, enabled); |
490 | |
491 if (enabled) { | |
492 DisplayAndroid primaryDisplay = DisplayAndroid.getNonMultiDisplay(mA ctivity); | |
mthiesse
2017/05/27 03:11:39
nit: Please share this logic with the other place
billorr
2017/05/30 18:22:16
Done.
| |
493 setContentCssSize( | |
494 primaryDisplay.getDisplayWidth(), primaryDisplay.getDisplayH eight(), WEBVR_DPR); | |
495 } else { | |
496 setContentCssSize(DEFAULT_CONTENT_WIDTH, DEFAULT_CONTENT_HEIGHT, DEF AULT_DPR); | |
497 } | |
490 } | 498 } |
491 | 499 |
492 @Override | 500 @Override |
493 public boolean getWebVrModeEnabled() { | 501 public boolean getWebVrModeEnabled() { |
494 return nativeGetWebVrMode(mNativeVrShell); | 502 return nativeGetWebVrMode(mNativeVrShell); |
495 } | 503 } |
496 | 504 |
497 @Override | 505 @Override |
498 public FrameLayout getContainer() { | 506 public FrameLayout getContainer() { |
499 return this; | 507 return this; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
638 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab s, | 646 private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTab s, |
639 Tab[] incognitoTabs); | 647 Tab[] incognitoTabs); |
640 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito , int id, | 648 private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito , int id, |
641 String title); | 649 String title); |
642 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito , int id); | 650 private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito , int id); |
643 private native Surface nativeTakeContentSurface(long nativeVrShell); | 651 private native Surface nativeTakeContentSurface(long nativeVrShell); |
644 private native void nativeRestoreContentSurface(long nativeVrShell); | 652 private native void nativeRestoreContentSurface(long nativeVrShell); |
645 private native void nativeSetHistoryButtonsEnabled( | 653 private native void nativeSetHistoryButtonsEnabled( |
646 long nativeVrShell, boolean canGoBack, boolean canGoForward); | 654 long nativeVrShell, boolean canGoBack, boolean canGoForward); |
647 } | 655 } |
OLD | NEW |