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

Side by Side Diff: chrome/browser/ssl/chrome_security_state_model_client.cc

Issue 1539043002: Pull SecurityStateModel out into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test debugging Created 4 years, 12 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/ssl/chrome_security_state_model_client.h" 5 #include "chrome/browser/ssl/chrome_security_state_model_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "chrome/browser/chromeos/policy/policy_cert_service.h" 10 #include "chrome/browser/chromeos/policy/policy_cert_service.h"
11 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" 11 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "content/public/browser/cert_store.h" 13 #include "content/public/browser/cert_store.h"
14 #include "content/public/browser/navigation_entry.h" 14 #include "content/public/browser/navigation_entry.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 #include "content/public/common/origin_util.h" 16 #include "content/public/common/origin_util.h"
17 #include "content/public/common/ssl_status.h" 17 #include "content/public/common/ssl_status.h"
18 #include "net/cert/x509_certificate.h" 18 #include "net/cert/x509_certificate.h"
19 19
20 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeSecurityStateModelClient); 20 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeSecurityStateModelClient);
21 21
22 using security_state::SecurityStateModel;
23
22 namespace { 24 namespace {
23 25
24 // Converts a content::SecurityStyle (an indicator of a request's 26 // Converts a content::SecurityStyle (an indicator of a request's
25 // overall security level computed by //content) into a 27 // overall security level computed by //content) into a
26 // SecurityStateModel::SecurityLevel (a finer-grained SecurityStateModel 28 // SecurityStateModel::SecurityLevel (a finer-grained SecurityStateModel
27 // concept that can express all of SecurityStateModel's policies that 29 // concept that can express all of SecurityStateModel's policies that
28 // //content doesn't necessarily know about). 30 // //content doesn't necessarily know about).
29 SecurityStateModel::SecurityLevel GetSecurityLevelForSecurityStyle( 31 SecurityStateModel::SecurityLevel GetSecurityLevelForSecurityStyle(
30 content::SecurityStyle style) { 32 content::SecurityStyle style) {
31 switch (style) { 33 switch (style) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 for (const auto& sct : ssl.signed_certificate_timestamp_ids) 112 for (const auto& sct : ssl.signed_certificate_timestamp_ids)
111 state->sct_verify_statuses.push_back(sct.status); 113 state->sct_verify_statuses.push_back(sct.status);
112 state->displayed_mixed_content = 114 state->displayed_mixed_content =
113 (ssl.content_status & content::SSLStatus::DISPLAYED_INSECURE_CONTENT) 115 (ssl.content_status & content::SSLStatus::DISPLAYED_INSECURE_CONTENT)
114 ? true 116 ? true
115 : false; 117 : false;
116 state->ran_mixed_content = 118 state->ran_mixed_content =
117 (ssl.content_status & content::SSLStatus::RAN_INSECURE_CONTENT) ? true 119 (ssl.content_status & content::SSLStatus::RAN_INSECURE_CONTENT) ? true
118 : false; 120 : false;
119 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698