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

Unified Diff: components/security_state/content/content_utils.h

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: refactor -> SecurityStateTabHelper. Created 4 years, 1 month 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: components/security_state/content/content_utils.h
diff --git a/components/security_state/content/content_utils.h b/components/security_state/content/content_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..99d90e80181cbcc2fb34eb5bde7c78dcd342ceb3
--- /dev/null
+++ b/components/security_state/content/content_utils.h
@@ -0,0 +1,35 @@
+// Copyright 2016 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 COMPONENTS_SECURITY_STATE_CONTENT_CONTENT_UTILS_H_
+#define COMPONENTS_SECURITY_STATE_CONTENT_CONTENT_UTILS_H_
+
+#include <memory>
+
+#include "components/security_state/core/security_state_model.h"
+#include "third_party/WebKit/public/platform/WebSecurityStyle.h"
+
+namespace content {
+struct SecurityStyleExplanations;
+class WebContents;
+}
+
+namespace security_state_content_utils {
blundell 2016/11/01 23:29:01 nit: this should just be the namespace of the comp
Eric Seckler 2016/11/03 17:01:06 Done.
+
+// Retrieves the visible security state that is relevant to the
+// SecurityStateModel from the current page in |web_contents|.
+std::unique_ptr<security_state::SecurityStateModel::VisibleSecurityState>
+GetVisibleSecurityState(content::WebContents* web_contents);
+
+// Returns the SecurityStyle that should be applied to a WebContents
+// with the given |security_info|. Populates
+// |security_style_explanations| to explain why the returned
+// SecurityStyle was chosen.
+blink::WebSecurityStyle GetSecurityStyle(
+ const security_state::SecurityStateModel::SecurityInfo& security_info,
+ content::SecurityStyleExplanations* security_style_explanations);
+
+} // namespace security_state_content_utils
+
+#endif // COMPONENTS_SECURITY_STATE_CONTENT_CONTENT_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698