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

Unified Diff: chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc

Issue 2434013002: Implement a means of letting native VR Shell control the HTML UI. (Closed)
Patch Set: Impelement a means of letting native VR Shell control the HTML UI. Created 4 years, 2 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/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
diff --git a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
index c970d84b09a05184467e30984398c8985f42c988..c9c6e510dcb924268e08e433b1f8fb1c7a321997 100644
--- a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
+++ b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
@@ -10,11 +10,13 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/values.h"
+#include "chrome/browser/android/vr_shell/ui_interface.h"
#include "chrome/browser/android/vr_shell/ui_scene.h"
#include "chrome/browser/android/vr_shell/vr_shell.h"
#include "content/public/browser/web_ui.h"
-VrShellUIMessageHandler::VrShellUIMessageHandler() = default;
+VrShellUIMessageHandler::VrShellUIMessageHandler() :
bshe 2016/10/19 21:02:40 nit: : move colon to next line
cjgrant 2016/10/20 15:25:39 Done.
+ weak_ptr_factory_(this) {}
VrShellUIMessageHandler::~VrShellUIMessageHandler() = default;
@@ -36,6 +38,8 @@ void VrShellUIMessageHandler::HandleDomLoaded(const base::ListValue* args) {
if (!vr_shell_)
return;
+ vr_shell_->GetUiInterface()->SetUiMessageHandler(
+ weak_ptr_factory_.GetWeakPtr());
vr_shell_->OnDomContentsLoaded();
}

Powered by Google App Engine
This is Rietveld 408576698