| 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
|
| index 0a60565bddff8f41ffaff9be4f9846f98fb59e6a..aec6c6fe46c6ec33de02d1e8bfd192c614fec9da 100644
|
| --- a/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
|
| +++ b/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
|
| @@ -4,11 +4,9 @@
|
|
|
| #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
|
|
|
| +#include "chrome/browser/android/vr_shell/toolbar_helper.h"
|
| #include "chrome/browser/android/vr_shell/ui_interface.h"
|
| #include "chrome/browser/android/vr_shell/vr_shell.h"
|
| -#include "chrome/browser/ssl/security_state_tab_helper.h"
|
| -#include "components/security_state/core/security_state.h"
|
| -#include "content/public/browser/navigation_handle.h"
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/render_widget_host.h"
|
| #include "content/public/browser/render_widget_host_view.h"
|
| @@ -16,13 +14,14 @@
|
| namespace vr_shell {
|
|
|
| VrWebContentsObserver::VrWebContentsObserver(content::WebContents* web_contents,
|
| + VrShell* vr_shell,
|
| UiInterface* ui_interface,
|
| - VrShell* vr_shell)
|
| + ToolbarHelper* toolbar)
|
| : WebContentsObserver(web_contents),
|
| + vr_shell_(vr_shell),
|
| ui_interface_(ui_interface),
|
| - vr_shell_(vr_shell) {
|
| - ui_interface_->SetURL(web_contents->GetVisibleURL());
|
| - DidChangeVisibleSecurityState();
|
| + toolbar_(toolbar) {
|
| + toolbar_->Update();
|
| }
|
|
|
| VrWebContentsObserver::~VrWebContentsObserver() {}
|
| @@ -41,33 +40,21 @@ void VrWebContentsObserver::DidStopLoading() {
|
|
|
| void VrWebContentsObserver::DidStartNavigation(
|
| content::NavigationHandle* navigation_handle) {
|
| - if (navigation_handle->IsInMainFrame()) {
|
| - ui_interface_->SetURL(navigation_handle->GetURL());
|
| - }
|
| + toolbar_->Update();
|
| }
|
|
|
| void VrWebContentsObserver::DidRedirectNavigation(
|
| content::NavigationHandle* navigation_handle) {
|
| - if (navigation_handle->IsInMainFrame()) {
|
| - ui_interface_->SetURL(navigation_handle->GetURL());
|
| - }
|
| + toolbar_->Update();
|
| }
|
|
|
| void VrWebContentsObserver::DidFinishNavigation(
|
| content::NavigationHandle* navigation_handle) {
|
| - if (navigation_handle->IsInMainFrame()) {
|
| - ui_interface_->SetURL(navigation_handle->GetURL());
|
| - }
|
| + toolbar_->Update();
|
| }
|
|
|
| void VrWebContentsObserver::DidChangeVisibleSecurityState() {
|
| - const auto* helper = SecurityStateTabHelper::FromWebContents(web_contents());
|
| - DCHECK(helper);
|
| - security_state::SecurityInfo security_info;
|
| - helper->GetSecurityInfo(&security_info);
|
| - bool malware = (security_info.malicious_content_status !=
|
| - security_state::MALICIOUS_CONTENT_STATUS_NONE);
|
| - ui_interface_->SetSecurityInfo(security_info.security_level, malware);
|
| + toolbar_->Update();
|
| }
|
|
|
| void VrWebContentsObserver::DidToggleFullscreenModeForTab(
|
|
|