| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h" |
| 6 |
| 7 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 8 #include "content/public/browser/navigation_handle.h" |
| 9 |
| 10 namespace vr_shell { |
| 11 |
| 12 VrWebContentsObserver::VrWebContentsObserver(content::WebContents* web_contents, |
| 13 UiInterface* ui_interface) |
| 14 : WebContentsObserver(web_contents), |
| 15 ui_interface_(ui_interface) {} |
| 16 |
| 17 VrWebContentsObserver::~VrWebContentsObserver() {} |
| 18 |
| 19 void VrWebContentsObserver::SetUiInterface(UiInterface* ui_interface) { |
| 20 ui_interface_ = ui_interface; |
| 21 } |
| 22 |
| 23 void VrWebContentsObserver::DidStartLoading() { |
| 24 ui_interface_->SetLoading(true); |
| 25 } |
| 26 |
| 27 void VrWebContentsObserver::DidStopLoading() { |
| 28 ui_interface_->SetLoading(false); |
| 29 } |
| 30 |
| 31 void VrWebContentsObserver::DidStartNavigation( |
| 32 content::NavigationHandle* navigation_handle) { |
| 33 ui_interface_->SetURL(navigation_handle->GetURL()); |
| 34 } |
| 35 |
| 36 void VrWebContentsObserver::DidRedirectNavigation( |
| 37 content::NavigationHandle* navigation_handle) { |
| 38 ui_interface_->SetURL(navigation_handle->GetURL()); |
| 39 } |
| 40 |
| 41 void VrWebContentsObserver::DidFinishNavigation( |
| 42 content::NavigationHandle* navigation_handle) { |
| 43 ui_interface_->SetURL(navigation_handle->GetURL()); |
| 44 } |
| 45 |
| 46 } // namespace vr_shell |
| OLD | NEW |