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

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

Issue 2536223002: Omnibox improvements and fixes. (Closed)
Patch Set: Rebase. Created 4 years 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
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 84165bd3865c8728f691ba705cce8e582f7dc693..f909df4a90d10afce5e300cb6c064849d7cd472b 100644
--- a/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
+++ b/chrome/browser/android/vr_shell/vr_web_contents_observer.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
#include "chrome/browser/android/vr_shell/ui_interface.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"
namespace vr_shell {
@@ -12,7 +14,10 @@ namespace vr_shell {
VrWebContentsObserver::VrWebContentsObserver(content::WebContents* web_contents,
UiInterface* ui_interface)
: WebContentsObserver(web_contents),
- ui_interface_(ui_interface) {}
+ ui_interface_(ui_interface) {
+ ui_interface_->SetURL(web_contents->GetVisibleURL());
+ SetSecurityLevel();
+}
VrWebContentsObserver::~VrWebContentsObserver() {}
@@ -30,23 +35,39 @@ void VrWebContentsObserver::DidStopLoading() {
void VrWebContentsObserver::DidStartNavigation(
content::NavigationHandle* navigation_handle) {
- ui_interface_->SetURL(navigation_handle->GetURL());
+ if (navigation_handle->IsInMainFrame()) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+ SetSecurityLevel();
estark 2016/12/02 23:48:50 Drive-by (not intending to block this CL, just not
+ }
}
void VrWebContentsObserver::DidRedirectNavigation(
content::NavigationHandle* navigation_handle) {
- ui_interface_->SetURL(navigation_handle->GetURL());
+ if (navigation_handle->IsInMainFrame()) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+ SetSecurityLevel();
+ }
}
void VrWebContentsObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
- ui_interface_->SetURL(navigation_handle->GetURL());
+ if (navigation_handle->IsInMainFrame()) {
+ ui_interface_->SetURL(navigation_handle->GetURL());
+ SetSecurityLevel();
+ }
+}
+
+void VrWebContentsObserver::SetSecurityLevel() {
+ const auto* helper = SecurityStateTabHelper::FromWebContents(web_contents());
+ DCHECK(helper);
+ security_state::SecurityInfo security_info;
+ helper->GetSecurityInfo(&security_info);
+ ui_interface_->SetSecurityLevel(security_info.security_level);
}
void VrWebContentsObserver::DidToggleFullscreenModeForTab(
bool entered_fullscreen, bool will_cause_resize) {
- // TODO(amp): Use will_cause_resize to signal ui of pending size changes.
- ui_interface_->SetCinemaMode(entered_fullscreen);
+ ui_interface_->SetFullscreen(entered_fullscreen);
}
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/vr_web_contents_observer.h ('k') | chrome/browser/resources/vr_shell/vr_shell_ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698