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

Unified Diff: content/browser/devtools/protocol/security_handler.cc

Issue 2562503002: Generalize WebContentsObserver::SecurityStyleChanged (Closed)
Patch Set: Fix nit. 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: content/browser/devtools/protocol/security_handler.cc
diff --git a/content/browser/devtools/protocol/security_handler.cc b/content/browser/devtools/protocol/security_handler.cc
index d3efa82257fbed81b3698de5f86068e161e2816d..f21ff9f9453a470f342bc6bfe42b94dcf40433ea 100644
--- a/content/browser/devtools/protocol/security_handler.cc
+++ b/content/browser/devtools/protocol/security_handler.cc
@@ -75,13 +75,9 @@ void SecurityHandler::AttachToRenderFrameHost() {
WebContents* web_contents = WebContents::FromRenderFrameHost(host_);
WebContentsObserver::Observe(web_contents);
- // Send an initial SecurityStyleChanged event.
+ // Send an initial DidChangeVisibleSecurityState event.
DCHECK(enabled_);
- SecurityStyleExplanations security_style_explanations;
- blink::WebSecurityStyle security_style =
- web_contents->GetDelegate()->GetSecurityStyle(
- web_contents, &security_style_explanations);
- SecurityStyleChanged(security_style, security_style_explanations);
+ DidChangeVisibleSecurityState();
}
void SecurityHandler::SetRenderFrameHost(RenderFrameHost* host) {
@@ -90,11 +86,14 @@ void SecurityHandler::SetRenderFrameHost(RenderFrameHost* host) {
AttachToRenderFrameHost();
}
-void SecurityHandler::SecurityStyleChanged(
- blink::WebSecurityStyle security_style,
- const SecurityStyleExplanations& security_style_explanations) {
+void SecurityHandler::DidChangeVisibleSecurityState() {
DCHECK(enabled_);
+ SecurityStyleExplanations security_style_explanations;
+ blink::WebSecurityStyle security_style =
+ web_contents()->GetDelegate()->GetSecurityStyle(
+ web_contents(), &security_style_explanations);
+
const std::string security_state =
SecurityStyleToProtocolSecurityState(security_style);
« no previous file with comments | « content/browser/devtools/protocol/security_handler.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698