OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
6 #define CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 SSLClientAuthObserver(net::SSLCertRequestInfo* cert_request_info, | 92 SSLClientAuthObserver(net::SSLCertRequestInfo* cert_request_info, |
93 SSLClientAuthHandler* handler); | 93 SSLClientAuthHandler* handler); |
94 virtual ~SSLClientAuthObserver(); | 94 virtual ~SSLClientAuthObserver(); |
95 | 95 |
96 // UI should implement this to close the dialog. | 96 // UI should implement this to close the dialog. |
97 virtual void OnCertSelectedByNotification() = 0; | 97 virtual void OnCertSelectedByNotification() = 0; |
98 | 98 |
99 // content::NotificationObserver implementation: | 99 // content::NotificationObserver implementation: |
100 virtual void Observe(int type, | 100 virtual void Observe(int type, |
101 const content::NotificationSource& source, | 101 const content::NotificationSource& source, |
102 const content::NotificationDetails& details); | 102 const content::NotificationDetails& details) OVERRIDE; |
103 | 103 |
104 // Begins observing notifications from other SSLClientAuthHandler instances. | 104 // Begins observing notifications from other SSLClientAuthHandler instances. |
105 // If another instance chooses a cert for a matching SSLCertRequestInfo, we | 105 // If another instance chooses a cert for a matching SSLCertRequestInfo, we |
106 // will also use the same cert and OnCertSelectedByNotification will be called | 106 // will also use the same cert and OnCertSelectedByNotification will be called |
107 // so that the cert selection UI can be closed. | 107 // so that the cert selection UI can be closed. |
108 void StartObserving(); | 108 void StartObserving(); |
109 | 109 |
110 // Stops observing notifications. We will no longer act on client auth | 110 // Stops observing notifications. We will no longer act on client auth |
111 // notifications. | 111 // notifications. |
112 void StopObserving(); | 112 void StopObserving(); |
113 | 113 |
114 private: | 114 private: |
115 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 115 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
116 | 116 |
117 scoped_refptr<SSLClientAuthHandler> handler_; | 117 scoped_refptr<SSLClientAuthHandler> handler_; |
118 | 118 |
119 content::NotificationRegistrar notification_registrar_; | 119 content::NotificationRegistrar notification_registrar_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthObserver); | 121 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthObserver); |
122 }; | 122 }; |
123 | 123 |
124 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 124 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
OLD | NEW |