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

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

Issue 2461503002: Provide URL-related info to the VR HTML UI. (Closed)
Patch Set: Rebase further ahead to resolve conflict. 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 d14efcd68f02ea36aea729138e461273752b26ee..4416da93a63b0f6e05bb76957de9c43796284bf2 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -14,6 +14,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_view_host.h"
#include "content/public/browser/render_widget_host.h"
@@ -143,6 +144,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();
@@ -690,6 +693,8 @@ base::WeakPtr<VrShell> VrShell::GetWeakPtr(
}
void VrShell::OnDomContentsLoaded() {
+ html_interface_->SetURL(main_contents_->GetVisibleURL());
+ html_interface_->SetLoading(main_contents_->IsLoading());
html_interface_->OnDomContentsLoaded();
}
@@ -796,6 +801,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.
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698