summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-24 11:37:30 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-24 11:37:30 +0000
commitc99c442ebbba18086f6a9d099000c855a8e3d7a6 (patch)
tree39b0091eb34cd5c0e16fee2fc43b6750c81c1d27 /content
parent1ca4dba7f881ea839466ca8179deae665fe1d11c (diff)
downloadchromium_src-c99c442ebbba18086f6a9d099000c855a8e3d7a6.zip
chromium_src-c99c442ebbba18086f6a9d099000c855a8e3d7a6.tar.gz
chromium_src-c99c442ebbba18086f6a9d099000c855a8e3d7a6.tar.bz2
- Add a new content settings type AUTO-SELECT-CERTIFICATE. The default value of the new content settings type AUTO-SELECT-CERTIFICATE is CONTENT_SETTING_ASK
- Add a policy for whitelisting origins for which client certificates should be auto selected. - Add a policy to set a default setting for the auto select certificates setting. BUG=81825 TEST=host_content_settings_map_unittest.cc, content_settings_policy_provider_unit_test.cc, configuration_policy_pref_store_unittest.cc Review URL: http://codereview.chromium.org/7537025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/content_browser_client.h8
-rw-r--r--content/browser/mock_content_browser_client.cc2
-rw-r--r--content/browser/mock_content_browser_client.h4
-rw-r--r--content/browser/ssl/ssl_client_auth_handler.cc6
-rw-r--r--content/browser/ssl/ssl_client_auth_handler.h9
5 files changed, 14 insertions, 15 deletions
diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h
index 4f0a53c..1547028 100644
--- a/content/browser/content_browser_client.h
+++ b/content/browser/content_browser_client.h
@@ -176,11 +176,9 @@ class ContentBrowserClient {
bool overridable,
Callback2<SSLCertErrorHandler*, bool>::Type* callback) = 0;
- // Shows the user a SSL client certificate selection dialog. When the user has
- // made a selection, the dialog will report back to |delegate|. |delegate| is
- // notified when the dialog closes in call cases; if the user cancels the
- // dialog, we call with a NULL certificate.
- virtual void ShowClientCertificateRequestDialog(
+ // Selects a SSL client certificate and returns it to the |handler|. If no
+ // certificate was selected NULL is returned to the |handler|.
+ virtual void SelectClientCertificate(
int render_process_id,
int render_view_id,
SSLClientAuthHandler* handler) = 0;
diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc
index 20fb578..7d01354 100644
--- a/content/browser/mock_content_browser_client.cc
+++ b/content/browser/mock_content_browser_client.cc
@@ -128,7 +128,7 @@ void MockContentBrowserClient::AllowCertificateError(
Callback2<SSLCertErrorHandler*, bool>::Type* callback) {
}
-void MockContentBrowserClient::ShowClientCertificateRequestDialog(
+void MockContentBrowserClient::SelectClientCertificate(
int render_process_id,
int render_view_id,
SSLClientAuthHandler* handler) {
diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h
index 50f57d3..9411910 100644
--- a/content/browser/mock_content_browser_client.h
+++ b/content/browser/mock_content_browser_client.h
@@ -6,6 +6,8 @@
#define CONTENT_BROWSER_MOCK_CONTENT_BROWSER_CLIENT_H_
#pragma once
+#include <string>
+
#include "base/compiler_specific.h"
#include "content/browser/content_browser_client.h"
@@ -61,7 +63,7 @@ class MockContentBrowserClient : public ContentBrowserClient {
SSLCertErrorHandler* handler,
bool overridable,
Callback2<SSLCertErrorHandler*, bool>::Type* callback) OVERRIDE;
- virtual void ShowClientCertificateRequestDialog(
+ virtual void SelectClientCertificate(
int render_process_id,
int render_view_id,
SSLClientAuthHandler* handler) OVERRIDE;
diff --git a/content/browser/ssl/ssl_client_auth_handler.cc b/content/browser/ssl/ssl_client_auth_handler.cc
index e179f9a..be78e77 100644
--- a/content/browser/ssl/ssl_client_auth_handler.cc
+++ b/content/browser/ssl/ssl_client_auth_handler.cc
@@ -46,7 +46,7 @@ void SSLClientAuthHandler::SelectCertificate() {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
- this, &SSLClientAuthHandler::ShowClientCertificateRequestDialog,
+ this, &SSLClientAuthHandler::DoSelectCertificate,
render_process_host_id, render_view_host_id));
}
@@ -94,9 +94,9 @@ void SSLClientAuthHandler::DoCertificateSelected(net::X509Certificate* cert) {
}
}
-void SSLClientAuthHandler::ShowClientCertificateRequestDialog(
+void SSLClientAuthHandler::DoSelectCertificate(
int render_process_host_id, int render_view_host_id) {
- content::GetContentClient()->browser()->ShowClientCertificateRequestDialog(
+ content::GetContentClient()->browser()->SelectClientCertificate(
render_process_host_id, render_view_host_id, this);
}
diff --git a/content/browser/ssl/ssl_client_auth_handler.h b/content/browser/ssl/ssl_client_auth_handler.h
index 4dbcaa7..4657c84 100644
--- a/content/browser/ssl/ssl_client_auth_handler.h
+++ b/content/browser/ssl/ssl_client_auth_handler.h
@@ -29,8 +29,7 @@ class SSLClientAuthHandler
SSLClientAuthHandler(net::URLRequest* request,
net::SSLCertRequestInfo* cert_request_info);
- // Asks the user to select a certificate and resumes the URL request with that
- // certificate.
+ // Selects a certificate and resumes the URL request with that certificate.
// Should only be called on the IO thread.
void SelectCertificate();
@@ -62,9 +61,9 @@ class SSLClientAuthHandler
// Called on the IO thread.
void DoCertificateSelected(net::X509Certificate* cert);
- // Calls the SSL helper on the UI thread.
- void ShowClientCertificateRequestDialog(int render_process_host_id,
- int render_view_host_id);
+ // Selects a client certificate on the UI thread.
+ void DoSelectCertificate(int render_process_host_id,
+ int render_view_host_id);
// The net::URLRequest that triggered this client auth.
net::URLRequest* request_;