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

Side by Side Diff: content/browser/devtools/protocol/security_handler.cc

Issue 1181293003: Expand SecurityStyleChanged interfaces to include explanations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add CONTENT_EXPORT Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/devtools/protocol/security_handler.h" 5 #include "content/browser/devtools/protocol/security_handler.h"
6 6
7 #include <string>
8
9 #include "content/public/browser/web_contents.h" 7 #include "content/public/browser/web_contents.h"
10 8
11 namespace content { 9 namespace content {
12 namespace devtools { 10 namespace devtools {
13 namespace security { 11 namespace security {
14 12
15 typedef DevToolsProtocolClient::Response Response; 13 typedef DevToolsProtocolClient::Response Response;
16 14
17 namespace { 15 namespace {
18 16
(...skipping 29 matching lines...) Expand all
48 void SecurityHandler::SetClient(scoped_ptr<Client> client) { 46 void SecurityHandler::SetClient(scoped_ptr<Client> client) {
49 client_.swap(client); 47 client_.swap(client);
50 } 48 }
51 49
52 void SecurityHandler::SetRenderFrameHost(RenderFrameHost* host) { 50 void SecurityHandler::SetRenderFrameHost(RenderFrameHost* host) {
53 host_ = host; 51 host_ = host;
54 if (enabled_ && host_) 52 if (enabled_ && host_)
55 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host_)); 53 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host_));
56 } 54 }
57 55
58 void SecurityHandler::SecurityStyleChanged(SecurityStyle security_style) { 56 void SecurityHandler::SecurityStyleChanged(
57 SecurityStyle security_style,
58 const SecurityStyleExplanations& security_style_explanations) {
59 DCHECK(enabled_); 59 DCHECK(enabled_);
60 60
61 const std::string security_state = 61 const std::string security_state =
62 SecurityStyleToProtocolSecurityState(security_style); 62 SecurityStyleToProtocolSecurityState(security_style);
63 client_->SecurityStateChanged( 63 client_->SecurityStateChanged(
64 SecurityStateChangedParams::Create()->set_security_state(security_state)); 64 SecurityStateChangedParams::Create()->set_security_state(security_state));
65 } 65 }
66 66
67 Response SecurityHandler::Enable() { 67 Response SecurityHandler::Enable() {
68 enabled_ = true; 68 enabled_ = true;
69 if (host_) 69 if (host_)
70 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host_)); 70 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host_));
71 return Response::OK(); 71 return Response::OK();
72 } 72 }
73 73
74 Response SecurityHandler::Disable() { 74 Response SecurityHandler::Disable() {
75 enabled_ = false; 75 enabled_ = false;
76 WebContentsObserver::Observe(nullptr); 76 WebContentsObserver::Observe(nullptr);
77 return Response::OK(); 77 return Response::OK();
78 } 78 }
79 79
80 } // namespace security 80 } // namespace security
81 } // namespace devtools 81 } // namespace devtools
82 } // namespace content 82 } // namespace content
OLDNEW
« 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