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

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

Issue 1163963002: Implement SecurityHandler to send the lock icon status to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fixes. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/security_handler.h
diff --git a/content/browser/devtools/protocol/security_handler.h b/content/browser/devtools/protocol/security_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..e4c0be74268ef15dd813c7cb86a46b6cecde20b5
--- /dev/null
+++ b/content/browser/devtools/protocol/security_handler.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_
+#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_
+
+#include "content/browser/devtools/devtools_protocol_handler.h"
+#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/common/security_style.h"
+
+namespace content {
+namespace devtools {
+namespace security {
+
+class SecurityHandler : private WebContentsObserver {
pfeldman 2015/06/09 18:36:44 Please rebaseline it on top of the stub.
lgarron 2015/06/09 18:54:45 The latest patch is already rebased onto the #incl
+ public:
+ typedef DevToolsProtocolClient::Response Response;
+
+ SecurityHandler();
+ ~SecurityHandler() override;
+
+ void SetClient(scoped_ptr<Client> client);
+ void SecurityStyleChanged(SecurityStyle security_style) override;
+ void SetRenderFrameHost(RenderFrameHost* host);
+
+ Response Enable();
+ Response Disable();
+
+ private:
+ std::string SecurityStyleToProtocolSecurityState(
+ content::SecurityStyle security_style);
+
+ scoped_ptr<Client> client_;
+ bool enabled_;
+ RenderFrameHost* host_;
+
+ DISALLOW_COPY_AND_ASSIGN(SecurityHandler);
+};
+
+} // namespace security
+} // namespace devtools
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698