| OLD | NEW |
| 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> | 7 #include <string> |
| 8 | 8 |
| 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
| 10 #include "content/public/browser/security_style_explanations.h" | 10 #include "content/public/browser/security_style_explanations.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 SecurityHandler::SecurityHandler() | 58 SecurityHandler::SecurityHandler() |
| 59 : enabled_(false), | 59 : enabled_(false), |
| 60 host_(nullptr) { | 60 host_(nullptr) { |
| 61 } | 61 } |
| 62 | 62 |
| 63 SecurityHandler::~SecurityHandler() { | 63 SecurityHandler::~SecurityHandler() { |
| 64 } | 64 } |
| 65 | 65 |
| 66 void SecurityHandler::SetClient(scoped_ptr<Client> client) { | 66 void SecurityHandler::SetClient(std::unique_ptr<Client> client) { |
| 67 client_.swap(client); | 67 client_.swap(client); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SecurityHandler::AttachToRenderFrameHost() { | 70 void SecurityHandler::AttachToRenderFrameHost() { |
| 71 DCHECK(host_); | 71 DCHECK(host_); |
| 72 WebContents* web_contents = WebContents::FromRenderFrameHost(host_); | 72 WebContents* web_contents = WebContents::FromRenderFrameHost(host_); |
| 73 WebContentsObserver::Observe(web_contents); | 73 WebContentsObserver::Observe(web_contents); |
| 74 | 74 |
| 75 // Send an initial SecurityStyleChanged event. | 75 // Send an initial SecurityStyleChanged event. |
| 76 DCHECK(enabled_); | 76 DCHECK(enabled_); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 Response SecurityHandler::Disable() { | 139 Response SecurityHandler::Disable() { |
| 140 enabled_ = false; | 140 enabled_ = false; |
| 141 WebContentsObserver::Observe(nullptr); | 141 WebContentsObserver::Observe(nullptr); |
| 142 return Response::OK(); | 142 return Response::OK(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace security | 145 } // namespace security |
| 146 } // namespace devtools | 146 } // namespace devtools |
| 147 } // namespace content | 147 } // namespace content |
| OLD | NEW |