Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java

Issue 2906173002: VR: Content size incorrect when transitioning from webVR into VR Shell (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698