OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 #include "content/public/common/url_utils.h" | 133 #include "content/public/common/url_utils.h" |
134 #include "content/public/common/web_preferences.h" | 134 #include "content/public/common/web_preferences.h" |
135 #include "device/devices_app/public/cpp/constants.h" | 135 #include "device/devices_app/public/cpp/constants.h" |
136 #include "device/devices_app/public/cpp/devices_app_factory.h" | 136 #include "device/devices_app/public/cpp/devices_app_factory.h" |
137 #include "gin/v8_initializer.h" | 137 #include "gin/v8_initializer.h" |
138 #include "mojo/application/public/cpp/application_delegate.h" | 138 #include "mojo/application/public/cpp/application_delegate.h" |
139 #include "net/base/mime_util.h" | 139 #include "net/base/mime_util.h" |
140 #include "net/cookies/canonical_cookie.h" | 140 #include "net/cookies/canonical_cookie.h" |
141 #include "net/cookies/cookie_options.h" | 141 #include "net/cookies/cookie_options.h" |
142 #include "net/ssl/ssl_cert_request_info.h" | 142 #include "net/ssl/ssl_cert_request_info.h" |
143 #include "net/ssl/ssl_platform_key.h" | |
143 #include "ppapi/host/ppapi_host.h" | 144 #include "ppapi/host/ppapi_host.h" |
144 #include "storage/browser/fileapi/external_mount_points.h" | 145 #include "storage/browser/fileapi/external_mount_points.h" |
145 #include "ui/base/l10n/l10n_util.h" | 146 #include "ui/base/l10n/l10n_util.h" |
146 #include "ui/base/resource/resource_bundle.h" | 147 #include "ui/base/resource/resource_bundle.h" |
147 #include "ui/resources/grit/ui_resources.h" | 148 #include "ui/resources/grit/ui_resources.h" |
148 | 149 |
149 #if defined(OS_WIN) | 150 #if defined(OS_WIN) |
150 #include "base/win/windows_version.h" | 151 #include "base/win/windows_version.h" |
151 #include "chrome/browser/chrome_browser_main_win.h" | 152 #include "chrome/browser/chrome_browser_main_win.h" |
152 #include "sandbox/win/src/sandbox_policy.h" | 153 #include "sandbox/win/src/sandbox_policy.h" |
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1972 // Try to automatically select a client certificate. | 1973 // Try to automatically select a client certificate. |
1973 if (filter->IsType(base::Value::TYPE_DICTIONARY)) { | 1974 if (filter->IsType(base::Value::TYPE_DICTIONARY)) { |
1974 base::DictionaryValue* filter_dict = | 1975 base::DictionaryValue* filter_dict = |
1975 static_cast<base::DictionaryValue*>(filter.get()); | 1976 static_cast<base::DictionaryValue*>(filter.get()); |
1976 | 1977 |
1977 const std::vector<scoped_refptr<net::X509Certificate> >& | 1978 const std::vector<scoped_refptr<net::X509Certificate> >& |
1978 all_client_certs = cert_request_info->client_certs; | 1979 all_client_certs = cert_request_info->client_certs; |
1979 for (size_t i = 0; i < all_client_certs.size(); ++i) { | 1980 for (size_t i = 0; i < all_client_certs.size(); ++i) { |
1980 if (CertMatchesFilter(*all_client_certs[i].get(), *filter_dict)) { | 1981 if (CertMatchesFilter(*all_client_certs[i].get(), *filter_dict)) { |
1981 // Use the first certificate that is matched by the filter. | 1982 // Use the first certificate that is matched by the filter. |
1982 delegate->ContinueWithCertificate(all_client_certs[i].get()); | 1983 // The following is not supported on Android since the client_certs list |
1984 // won't be populated. | |
1985 #if !defined(OS_ANDROID) | |
davidben
2015/09/25 20:10:11
I'd probably just wrap the whole thing.
svaldez
2015/09/28 16:54:52
Done.
| |
1986 delegate->ContinueWithCertificate( | |
1987 all_client_certs[i].get(), | |
1988 FetchClientCertPrivateKey(all_client_certs[i].get()).get()); | |
1989 #endif | |
1983 return; | 1990 return; |
1984 } | 1991 } |
1985 } | 1992 } |
1986 } else { | 1993 } else { |
1987 NOTREACHED(); | 1994 NOTREACHED(); |
1988 } | 1995 } |
1989 } | 1996 } |
1990 | 1997 |
1991 chrome::ShowSSLClientCertificateSelector(web_contents, cert_request_info, | 1998 chrome::ShowSSLClientCertificateSelector(web_contents, cert_request_info, |
1992 delegate.Pass()); | 1999 delegate.Pass()); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2669 if (channel <= kMaxDisableEncryptionChannel) { | 2676 if (channel <= kMaxDisableEncryptionChannel) { |
2670 static const char* const kWebRtcDevSwitchNames[] = { | 2677 static const char* const kWebRtcDevSwitchNames[] = { |
2671 switches::kDisableWebRtcEncryption, | 2678 switches::kDisableWebRtcEncryption, |
2672 }; | 2679 }; |
2673 to_command_line->CopySwitchesFrom(from_command_line, | 2680 to_command_line->CopySwitchesFrom(from_command_line, |
2674 kWebRtcDevSwitchNames, | 2681 kWebRtcDevSwitchNames, |
2675 arraysize(kWebRtcDevSwitchNames)); | 2682 arraysize(kWebRtcDevSwitchNames)); |
2676 } | 2683 } |
2677 } | 2684 } |
2678 #endif // defined(ENABLE_WEBRTC) | 2685 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |