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

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

Issue 2539763004: Don't dispatch vrdisplayactivate event if the page that listens for it is invisible (Closed)
Patch Set: nit Created 4 years 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
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.app.Activity; 7 import android.app.Activity;
8 import android.app.PendingIntent; 8 import android.app.PendingIntent;
9 import android.content.ComponentName; 9 import android.content.ComponentName;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 @Override 78 @Override
79 public Boolean isDaydreamCurrentViewer() { 79 public Boolean isDaydreamCurrentViewer() {
80 DaydreamApi daydreamApi = DaydreamApi.create(mActivity); 80 DaydreamApi daydreamApi = DaydreamApi.create(mActivity);
81 if (daydreamApi == null) return false; 81 if (daydreamApi == null) return false;
82 int type = daydreamApi.getCurrentViewerType(); 82 int type = daydreamApi.getCurrentViewerType();
83 daydreamApi.close(); 83 daydreamApi.close();
84 return type == GvrApi.ViewerType.DAYDREAM; 84 return type == GvrApi.ViewerType.DAYDREAM;
85 } 85 }
86
87 @Override
88 public void launchVrHomescreen() {
89 DaydreamApi daydreamApi = DaydreamApi.create(mActivity);
90 if (daydreamApi == null) return;
91 daydreamApi.launchVrHomescreen();
92 daydreamApi.close();
93 }
86 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698