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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2833773005: Pause drawing webvr when the App button is pressed (Closed)
Patch Set: nit Created 3 years, 8 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
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 224ea195a9c83bc1cb4baac5bb16031b24f6cff1..fb80fe537ee45f2b6d772784b7467ae392d4d91b 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -208,21 +208,16 @@ void VrShell::PostToGlThreadWhenReady(const base::Closure& task) {
gl_thread_->task_runner()->PostTask(FROM_HERE, task);
}
-void VrShell::SetContentPaused(bool paused) {
- if (content_paused_ == paused)
- return;
- content_paused_ = paused;
-
+void VrShell::OnContentPaused(bool paused) {
if (!delegate_provider_->device_provider())
return;
// TODO(mthiesse): The page is no longer visible when in menu mode. We
// should unfocus or otherwise let it know it's hidden.
- if (paused) {
+ if (paused)
delegate_provider_->device_provider()->Device()->OnBlur();
- } else {
+ else
delegate_provider_->device_provider()->Device()->OnFocus();
- }
}
void VrShell::OnTriggerEvent(JNIEnv* env, const JavaParamRef<jobject>& obj) {
@@ -402,9 +397,11 @@ void VrShell::AppButtonGesturePerformed(UiInterface::Direction direction) {
ui_->HandleAppButtonGesturePerformed(direction);
}
-void VrShell::AppButtonPressed() {
- if (vr_shell_enabled_)
+void VrShell::AppButtonPressed(bool content_paused) {
+ if (vr_shell_enabled_) {
+ OnContentPaused(content_paused);
ui_->HandleAppButtonClicked();
+ }
}
void VrShell::ContentPhysicalBoundsChanged(JNIEnv* env,
@@ -424,9 +421,6 @@ void VrShell::DoUiAction(const UiAction action,
// Actions that can be handled natively.
switch (action) {
case SET_CONTENT_PAUSED: {
bshe 2017/04/21 21:08:42 wondering if this UiAction is still needed? If not
ymalik 2017/04/28 00:12:04 I think we have it here as reference for things th
- bool paused;
- CHECK(arguments->GetBoolean("paused", &paused));
- SetContentPaused(paused);
return;
}
case HISTORY_BACK:

Powered by Google App Engine
This is Rietveld 408576698