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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java

Issue 1257283007: Voice input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve documentation. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/CardboardDesktopActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java b/remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java
index a5db293d55078e1e9df2491058eb6abb51103158..33aa5e853a37cf73d9744787a1d9938eabe171b0 100644
--- a/remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java
+++ b/remoting/android/java/src/org/chromium/chromoting/CardboardDesktopRenderer.java
@@ -375,9 +375,10 @@ public class CardboardDesktopRenderer implements CardboardView.StereoRenderer {
return value;
}
+
/**
- * Check whether user is looking at desktop or not.
- * This can be called on any thread.
+ * Return true if user is looking at the desktop.
+ * This method can be called on any thread.
*/
public boolean isLookingAtDesktop() {
synchronized (mEyePositionLock) {
@@ -386,6 +387,26 @@ public class CardboardDesktopRenderer implements CardboardView.StereoRenderer {
}
}
+ /*
+ * Return true if user is looking at the space to the left of the dekstop.
+ * This method can be called on any thread.
+ */
+ public boolean isLookingLeftOfDesktop() {
+ synchronized (mEyePositionLock) {
+ return mEyePositionVector[0] >= (mHalfDesktopWidth + EDGE_MARGIN);
+ }
+ }
+
+ /*
+ * Return true if user is looking at the space to the right of the dekstop.
+ * This method can be called on any thread.
+ */
+ public boolean isLookingRightOfDesktop() {
+ synchronized (mEyePositionLock) {
+ return mEyePositionVector[0] <= -(mHalfDesktopWidth + EDGE_MARGIN);
+ }
+ }
+
/**
* Get position on desktop where user is looking at.
*/
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/CardboardDesktopActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698