Chromium Code Reviews| 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..265d956eb134269156d28896b3cb66b6c4cf0e79 |
| --- /dev/null |
| +++ b/chrome/browser/android/vr_shell/vr_web_contents_observer.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
bshe
2016/10/27 20:27:44
nit: 2016
|
| +// 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() { |
|
mthiesse
2016/10/27 21:31:17
nit: newline here and below.
cjgrant
2016/10/28 14:16:59
Done.
|
| + ui_interface_->SetLoading(false); |
| +} |
| +void VrWebContentsObserver::DidStartNavigation( |
| + content::NavigationHandle* navigation_handle) { |
| + ui_interface_->SetURL(navigation_handle->GetURL()); |
|
bshe
2016/10/27 20:27:44
Not sure if redirect URL works?
cjgrant
2016/10/28 14:16:59
You were right, this was incomplete. I now cover
bshe
2016/10/28 14:33:14
Do you need to update intermediate urls? It looks
|
| +} |
| + |
| +} // namespace vr_shell |