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

Side by Side Diff: chrome/browser/android/vr_shell/vr_web_contents_observer.cc

Issue 2946523002: VR: Support security chip text on URL bar. (Closed)
Patch Set: Address comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h" 5 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
6 6
7 #include "chrome/browser/android/vr_shell/ui_interface.h" 7 #include "chrome/browser/android/vr_shell/ui_interface.h"
8 #include "chrome/browser/android/vr_shell/vr_shell.h" 8 #include "chrome/browser/android/vr_shell/vr_shell.h"
9 #include "chrome/browser/ssl/security_state_tab_helper.h" 9 #include "chrome/browser/ssl/security_state_tab_helper.h"
10 #include "components/security_state/core/security_state.h" 10 #include "components/security_state/core/security_state.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (navigation_handle->IsInMainFrame()) { 58 if (navigation_handle->IsInMainFrame()) {
59 ui_interface_->SetURL(navigation_handle->GetURL()); 59 ui_interface_->SetURL(navigation_handle->GetURL());
60 } 60 }
61 } 61 }
62 62
63 void VrWebContentsObserver::DidChangeVisibleSecurityState() { 63 void VrWebContentsObserver::DidChangeVisibleSecurityState() {
64 const auto* helper = SecurityStateTabHelper::FromWebContents(web_contents()); 64 const auto* helper = SecurityStateTabHelper::FromWebContents(web_contents());
65 DCHECK(helper); 65 DCHECK(helper);
66 security_state::SecurityInfo security_info; 66 security_state::SecurityInfo security_info;
67 helper->GetSecurityInfo(&security_info); 67 helper->GetSecurityInfo(&security_info);
68 ui_interface_->SetSecurityLevel(security_info.security_level); 68 bool malware = (security_info.malicious_content_status !=
69 security_state::MALICIOUS_CONTENT_STATUS_NONE);
70 ui_interface_->SetSecurityInfo(security_info.security_level, malware);
69 } 71 }
70 72
71 void VrWebContentsObserver::DidToggleFullscreenModeForTab( 73 void VrWebContentsObserver::DidToggleFullscreenModeForTab(
72 bool entered_fullscreen, 74 bool entered_fullscreen,
73 bool will_cause_resize) { 75 bool will_cause_resize) {
74 vr_shell_->OnFullscreenChanged(entered_fullscreen); 76 vr_shell_->OnFullscreenChanged(entered_fullscreen);
75 } 77 }
76 78
77 void VrWebContentsObserver::WebContentsDestroyed() { 79 void VrWebContentsObserver::WebContentsDestroyed() {
78 vr_shell_->ContentWebContentsDestroyed(); 80 vr_shell_->ContentWebContentsDestroyed();
(...skipping 11 matching lines...) Expand all
90 vr_shell_->ContentFrameWasResized(width_changed); 92 vr_shell_->ContentFrameWasResized(width_changed);
91 } 93 }
92 94
93 void VrWebContentsObserver::RenderViewHostChanged( 95 void VrWebContentsObserver::RenderViewHostChanged(
94 content::RenderViewHost* old_host, 96 content::RenderViewHost* old_host,
95 content::RenderViewHost* new_host) { 97 content::RenderViewHost* new_host) {
96 new_host->GetWidget()->GetView()->SetIsInVR(true); 98 new_host->GetWidget()->GetView()->SetIsInVR(true);
97 } 99 }
98 100
99 } // namespace vr_shell 101 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698