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

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

Issue 2960903002: VR: Use ToolbarModel to drive VR URL bar state. (Closed)
Patch Set: Update toolbar build file to include vector icons for Android. Created 3 years, 6 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') | components/toolbar/BUILD.gn » ('j') | 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
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(
« no previous file with comments | « chrome/browser/android/vr_shell/vr_web_contents_observer.h ('k') | components/toolbar/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698