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

Unified Diff: chrome/browser/android/vr_shell/vr_web_contents_observer.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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_web_contents_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_web_contents_observer.cc
diff --git a/chrome/browser/android/vr_shell/vr_web_contents_observer.cc b/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..631221913fb95381a0d1c8787033dad7d72735a8
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
+
+#include "chrome/browser/android/vr_shell/ui_interface.h"
+#include "content/public/browser/navigation_handle.h"
+
+namespace vr_shell {
+
+VrWebContentsObserver::VrWebContentsObserver(content::WebContents* web_contents,
+ UiInterface* ui_interface)
+ : WebContentsObserver(web_contents),
+ ui_interface_(ui_interface) {}
+
+VrWebContentsObserver::~VrWebContentsObserver() {}
+
+void VrWebContentsObserver::SetUiInterface(UiInterface* ui_interface) {
+ ui_interface_ = ui_interface;
+}
+
+void VrWebContentsObserver::DidStartLoading() {
+ ui_interface_->SetLoading(true);
+}
+
+void VrWebContentsObserver::DidStopLoading() {
+ ui_interface_->SetLoading(false);
+}
+
+void VrWebContentsObserver::DidStartNavigation(
+ content::NavigationHandle* navigation_handle) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+}
+
+void VrWebContentsObserver::DidRedirectNavigation(
+ content::NavigationHandle* navigation_handle) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+}
+
+void VrWebContentsObserver::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+}
+
+} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/vr_web_contents_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698