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

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

Issue 2461503002: Provide URL-related info to the VR HTML UI. (Closed)
Patch Set: 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/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 3cd8d383df4ac186e88d645b003a6a2af814e738..f66f61d4c1aa1e95565548baf2f8a482997205ee 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/android/vr_shell/vr_input_manager.h"
#include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
#include "chrome/browser/android/vr_shell/vr_shell_renderer.h"
+#include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -125,6 +126,8 @@ VrShell::VrShell(JNIEnv* env, jobject obj,
html_interface_.reset(new UiInterface);
content_compositor_.reset(new VrCompositor(content_window, false));
ui_compositor_.reset(new VrCompositor(ui_window, true));
+ vr_web_contents_observer_.reset(
+ new VrWebContentsObserver(main_contents, html_interface_.get()));
LoadUIContent();
@@ -678,6 +681,8 @@ void VrShell::OnDomContentsLoaded() {
// should fix.
ui_contents_->GetRenderWidgetHostView()->SetBackgroundColor(
SK_ColorTRANSPARENT);
+ html_interface_->SetURL(main_contents_->GetVisibleURL());
+ html_interface_->SetLoading(main_contents_->IsLoading());
html_interface_->OnDomContentsLoaded();
}
@@ -784,6 +789,7 @@ void VrShell::DoUiAction(const UiAction action) {
ui_contents_->GetController().Reload(false);
html_interface_.reset(new UiInterface);
html_interface_->SetMode(UiInterface::Mode::STANDARD);
+ vr_web_contents_observer_->SetUiInterface(html_interface_.get());
break;
#endif
case ZOOM_OUT: // Not handled yet.

Powered by Google App Engine
This is Rietveld 408576698