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

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

Issue 2773903003: Add way to get native VR UI information from Java (Closed)
Patch Set: Address cjgrant@ comments + stability improvement Created 3 years, 9 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_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index c3b906768d2fd7e09fea01670323b19e788e14ad..8e08326f5a9acf0f66817bed2c5ff994382ff08a 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -6,6 +6,7 @@
#include <chrono>
#include <limits>
+#include <string>
#include <utility>
#include "base/android/jni_android.h"
@@ -340,6 +341,20 @@ void VrShellGl::SetSubmitClient(
submit_client_.Bind(std::move(submit_client_info));
}
+void VrShellGl::CreateUiElementInfos(
+ const std::vector<std::string>& element_names,
+ int callback_id,
+ base::Callback<void(int, std::unique_ptr<base::DictionaryValue>)>
+ on_created) {
+ auto reply = base::MakeUnique<base::DictionaryValue>();
+ for (const auto& name : element_names) {
+ reply->Set(name, std::move(scene_->CreateUiElementInfo(name)));
+ }
+ main_thread_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(on_created, callback_id, base::Passed(std::move(reply))));
+}
+
void VrShellGl::OnUIFrameAvailable() {
ui_surface_texture_->UpdateTexImage();
}

Powered by Google App Engine
This is Rietveld 408576698