| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ | 5 #ifndef IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ |
| 6 #define IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ | 6 #define IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #import <Security/Security.h> |
| 9 | 10 |
| 11 #include "base/mac/scoped_cftyperef.h" |
| 10 #include "ios/web/public/security_style.h" | 12 #include "ios/web/public/security_style.h" |
| 11 #include "net/cert/cert_status_flags.h" | 13 #include "net/cert/cert_status_flags.h" |
| 12 | 14 |
| 13 namespace web { | 15 namespace web { |
| 14 class NavigationItem; | 16 class NavigationItem; |
| 15 class NavigationManager; | 17 class NavigationManager; |
| 16 } | 18 } |
| 17 | 19 |
| 18 @protocol CRWSSLStatusUpdaterDataSource; | 20 @protocol CRWSSLStatusUpdaterDataSource; |
| 19 @protocol CRWSSLStatusUpdaterDelegate; | 21 @protocol CRWSSLStatusUpdaterDelegate; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 31 - (instancetype)initWithDataSource:(id<CRWSSLStatusUpdaterDataSource>)dataSource | 33 - (instancetype)initWithDataSource:(id<CRWSSLStatusUpdaterDataSource>)dataSource |
| 32 navigationManager:(web::NavigationManager*)navigationManager | 34 navigationManager:(web::NavigationManager*)navigationManager |
| 33 certGroupID:(int)certGroupID NS_DESIGNATED_INITIALIZER; | 35 certGroupID:(int)certGroupID NS_DESIGNATED_INITIALIZER; |
| 34 | 36 |
| 35 - (instancetype)init NS_UNAVAILABLE; | 37 - (instancetype)init NS_UNAVAILABLE; |
| 36 | 38 |
| 37 // Updates SSL status for the current navigation item. The SSL Status is | 39 // Updates SSL status for the current navigation item. The SSL Status is |
| 38 // obtained from |host|, |chain| and |hasOnlySecureContent| flag. | 40 // obtained from |host|, |chain| and |hasOnlySecureContent| flag. |
| 39 - (void)updateSSLStatusForNavigationItem:(web::NavigationItem*)navigationItem | 41 - (void)updateSSLStatusForNavigationItem:(web::NavigationItem*)navigationItem |
| 40 withCertHost:(NSString*)host | 42 withCertHost:(NSString*)host |
| 41 certChain:(NSArray*)chain | 43 trust: |
| 44 (base::ScopedCFTypeRef<SecTrustRef>)trust |
| 42 hasOnlySecureContent:(BOOL)hasOnlySecureContent; | 45 hasOnlySecureContent:(BOOL)hasOnlySecureContent; |
| 43 | 46 |
| 44 @end | 47 @end |
| 45 | 48 |
| 46 // |SSLStatusUpdater:querySSLStatusForTrust:host:completionHandler| completion | 49 // |SSLStatusUpdater:querySSLStatusForTrust:host:completionHandler| completion |
| 47 // handler. | 50 // handler. |
| 48 typedef void (^StatusQueryHandler)(web::SecurityStyle, net::CertStatus); | 51 typedef void (^StatusQueryHandler)(web::SecurityStyle, net::CertStatus); |
| 49 | 52 |
| 50 // DataSource for CRWSSLStatusUpdater. | 53 // DataSource for CRWSSLStatusUpdater. |
| 51 @protocol CRWSSLStatusUpdaterDataSource | 54 @protocol CRWSSLStatusUpdaterDataSource |
| 52 | 55 |
| 53 @required | 56 @required |
| 54 | 57 |
| 55 // Called when updater needs SSLStatus for the given |certChain| and |host|. | 58 // Called when updater needs SSLStatus for the given |certChain| and |host|. |
| 56 // |completionHandler| is called asynchronously when web::SecurityStyle and | 59 // |completionHandler| is called asynchronously when web::SecurityStyle and |
| 57 // net::CertStatus are computed. | 60 // net::CertStatus are computed. |
| 58 - (void)SSLStatusUpdater:(CRWSSLStatusUpdater*)SSLStatusUpdater | 61 - (void)SSLStatusUpdater:(CRWSSLStatusUpdater*)SSLStatusUpdater |
| 59 querySSLStatusForCertChain:(NSArray*)certChain | 62 querySSLStatusForTrust:(base::ScopedCFTypeRef<SecTrustRef>)trust |
| 60 host:(NSString*)host | 63 host:(NSString*)host |
| 61 completionHandler:(StatusQueryHandler)completionHandler; | 64 completionHandler:(StatusQueryHandler)completionHandler; |
| 62 | 65 |
| 63 @end | 66 @end |
| 64 | 67 |
| 65 // Delegate for CRWSSLStatusUpdater. | 68 // Delegate for CRWSSLStatusUpdater. |
| 66 @protocol CRWSSLStatusUpdaterDelegate<NSObject> | 69 @protocol CRWSSLStatusUpdaterDelegate<NSObject> |
| 67 | 70 |
| 68 @optional | 71 @optional |
| 69 | 72 |
| 70 // Called if SSLStatus has been changed for the given navigation item. May be | 73 // Called if SSLStatus has been changed for the given navigation item. May be |
| 71 // called multiple times for a single update or not called at all if SSLStatus | 74 // called multiple times for a single update or not called at all if SSLStatus |
| 72 // has not been changed for the requested navigation item. | 75 // has not been changed for the requested navigation item. |
| 73 - (void)SSLStatusUpdater:(CRWSSLStatusUpdater*)SSLStatusUpdater | 76 - (void)SSLStatusUpdater:(CRWSSLStatusUpdater*)SSLStatusUpdater |
| 74 didChangeSSLStatusForNavigationItem:(web::NavigationItem*)navigationItem; | 77 didChangeSSLStatusForNavigationItem:(web::NavigationItem*)navigationItem; |
| 75 | 78 |
| 76 @end | 79 @end |
| 77 | 80 |
| 78 #endif // IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ | 81 #endif // IOS_WEB_NET_CRW_SSL_STATUS_UPDATER_H_ |
| OLD | NEW |