OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
6 #define CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 6 #define CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
(...skipping 12 matching lines...) Expand all Loading... |
24 // Ensure that the specified message is displayed to the user. This will | 24 // Ensure that the specified message is displayed to the user. This will |
25 // display an InfoBar at the top of the associated tab. | 25 // display an InfoBar at the top of the associated tab. |
26 void ShowMessage(const std::wstring& msg); | 26 void ShowMessage(const std::wstring& msg); |
27 | 27 |
28 // Same as ShowMessage but also contains a link that when clicked run the | 28 // Same as ShowMessage but also contains a link that when clicked run the |
29 // specified task. The SSL Manager becomes the owner of the task. | 29 // specified task. The SSL Manager becomes the owner of the task. |
30 void ShowMessageWithLink(const std::wstring& msg, | 30 void ShowMessageWithLink(const std::wstring& msg, |
31 const std::wstring& link_text, | 31 const std::wstring& link_text, |
32 Task* task); | 32 Task* task); |
33 | 33 |
34 // Records that a host is "broken," that is, the origin for that host has been | 34 // Records that a host has run insecure content. |
35 // contaminated with insecure content, either via HTTP or via HTTPS with a | 35 void HostRanInsecureContent(const std::string& host, int pid); |
36 // bad certificate. | |
37 void MarkHostAsBroken(const std::string& host, int pid); | |
38 | 36 |
39 // Returns whether the specified host was marked as broken. | 37 // Returns whether the specified host ran insecure content. |
40 bool DidMarkHostAsBroken(const std::string& host, int pid) const; | 38 bool DidHostRunInsecureContent(const std::string& host, int pid) const; |
41 | 39 |
42 // Records that |cert| is permitted to be used for |host| in the future. | 40 // Records that |cert| is permitted to be used for |host| in the future. |
43 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); | 41 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); |
44 | 42 |
45 // Records that |cert| is not permitted to be used for |host| in the future. | 43 // Records that |cert| is not permitted to be used for |host| in the future. |
46 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); | 44 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); |
47 | 45 |
48 // Queries whether |cert| is allowed or denied for |host|. | 46 // Queries whether |cert| is allowed or denied for |host|. |
49 net::X509Certificate::Policy::Judgment QueryPolicy( | 47 net::X509Certificate::Policy::Judgment QueryPolicy( |
50 net::X509Certificate* cert, const std::string& host); | 48 net::X509Certificate* cert, const std::string& host); |
(...skipping 22 matching lines...) Expand all Loading... |
73 bool operator==(const std::wstring& other_message) const { | 71 bool operator==(const std::wstring& other_message) const { |
74 // We are uniquing SSLMessageInfo by their message only. | 72 // We are uniquing SSLMessageInfo by their message only. |
75 return message == other_message; | 73 return message == other_message; |
76 } | 74 } |
77 | 75 |
78 std::wstring message; | 76 std::wstring message; |
79 std::wstring link_text; | 77 std::wstring link_text; |
80 Task* action; | 78 Task* action; |
81 }; | 79 }; |
82 | 80 |
83 // Dispatch NotificationType::SSL_INTERNAL_STATE_CHANGED notification. | |
84 void DispatchSSLInternalStateChanged(); | |
85 | |
86 // The NavigationController that owns this SSLManager. We are responsible | 81 // The NavigationController that owns this SSLManager. We are responsible |
87 // for the security UI of this tab. | 82 // for the security UI of this tab. |
88 NavigationController* controller_; | 83 NavigationController* controller_; |
89 | 84 |
90 // SSL state specific for each host. | 85 // SSL state specific for each host. |
91 SSLHostState* ssl_host_state_; | 86 SSLHostState* ssl_host_state_; |
92 | 87 |
93 // The list of messages that should be displayed (in info bars) when the page | 88 // The list of messages that should be displayed (in info bars) when the page |
94 // currently loading had loaded. | 89 // currently loading had loaded. |
95 std::vector<SSLMessageInfo> pending_messages_; | 90 std::vector<SSLMessageInfo> pending_messages_; |
96 | 91 |
97 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); | 92 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); |
98 }; | 93 }; |
99 | 94 |
100 #endif // CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 95 #endif // CHROME_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
OLD | NEW |