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

Unified Diff: ios/chrome/browser/ssl/ios_security_state_tab_helper.h

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: sync. 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: ios/chrome/browser/ssl/ios_security_state_tab_helper.h
diff --git a/ios/chrome/browser/ssl/ios_security_state_tab_helper.h b/ios/chrome/browser/ssl/ios_security_state_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..d224ad0a144ab312ed04ec516bc4e0c996b97577
--- /dev/null
+++ b/ios/chrome/browser/ssl/ios_security_state_tab_helper.h
@@ -0,0 +1,44 @@
+// 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 IOS_CHROME_BROWSER_SSL_IOS_SECURITY_STATE_TAB_HELPER_H_
+#define IOS_CHROME_BROWSER_SSL_IOS_SECURITY_STATE_TAB_HELPER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "ios/web/public/web_state/web_state_user_data.h"
+
+namespace security_state {
+struct SecurityInfo;
+struct VisibleSecurityState;
+} // namespace security_state
+
+namespace web {
+class WebState;
+} // namespace web
+
+// Tab helper that provides the page's security status. Uses a WebState to
+// provide a security_state::GetSecurityInfo() with the relevant
+// VisibleSecurityState information.
+class IOSSecurityStateTabHelper
+ : public web::WebStateUserData<IOSSecurityStateTabHelper> {
+ public:
+ ~IOSSecurityStateTabHelper() override;
+
+ void GetSecurityInfo(security_state::SecurityInfo* result) const;
+
+ private:
+ explicit IOSSecurityStateTabHelper(web::WebState* web_state);
+ friend class web::WebStateUserData<IOSSecurityStateTabHelper>;
+
+ std::unique_ptr<security_state::VisibleSecurityState>
+ GetVisibleSecurityState() const;
+
+ web::WebState* web_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSSecurityStateTabHelper);
+};
+
+#endif // IOS_CHROME_BROWSER_SSL_IOS_SECURITY_STATE_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698