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 "components/security_state/security_state_model.h" | 5 #include "components/security_state/security_state_model.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "components/security_state/security_state_model_client.h" | 9 #include "components/security_state/security_state_model_client.h" |
10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 SecurityStateModel::SecurityLevel security_level) { | 58 SecurityStateModel::SecurityLevel security_level) { |
59 initial_security_level_ = security_level; | 59 initial_security_level_ = security_level; |
60 } | 60 } |
61 | 61 |
62 // SecurityStateModelClient: | 62 // SecurityStateModelClient: |
63 void GetVisibleSecurityState( | 63 void GetVisibleSecurityState( |
64 SecurityStateModel::VisibleSecurityState* state) override { | 64 SecurityStateModel::VisibleSecurityState* state) override { |
65 state->connection_info_initialized = true; | 65 state->connection_info_initialized = true; |
66 state->url = GURL(kUrl); | 66 state->url = GURL(kUrl); |
67 state->initial_security_level = initial_security_level_; | 67 state->initial_security_level = initial_security_level_; |
68 state->cert_id = 1; | |
69 state->cert_status = cert_status_; | 68 state->cert_status = cert_status_; |
70 state->connection_status = connection_status_; | 69 state->connection_status = connection_status_; |
71 state->security_bits = 256; | 70 state->security_bits = 256; |
72 state->displayed_mixed_content = displayed_mixed_content_; | 71 state->displayed_mixed_content = displayed_mixed_content_; |
73 state->ran_mixed_content = ran_mixed_content_; | 72 state->ran_mixed_content = ran_mixed_content_; |
74 state->fails_malware_check = fails_malware_check_; | 73 state->fails_malware_check = fails_malware_check_; |
75 } | 74 } |
76 | 75 |
77 bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override { | 76 bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override { |
78 *cert = cert_; | 77 *cert = cert_; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 client.set_fails_malware_check(true); | 224 client.set_fails_malware_check(true); |
226 const SecurityStateModel::SecurityInfo& security_info = | 225 const SecurityStateModel::SecurityInfo& security_info = |
227 model.GetSecurityInfo(); | 226 model.GetSecurityInfo(); |
228 EXPECT_TRUE(security_info.fails_malware_check); | 227 EXPECT_TRUE(security_info.fails_malware_check); |
229 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info.security_level); | 228 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info.security_level); |
230 } | 229 } |
231 | 230 |
232 } // namespace | 231 } // namespace |
233 | 232 |
234 } // namespace security_state | 233 } // namespace security_state |
OLD | NEW |