| 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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
| 90 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 90 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
| 91 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 91 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
| 92 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 92 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
| 93 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 93 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
| 94 #include "chrome/browser/chromeos/settings/cros_settings.h" | 94 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 95 #include "chromeos/settings/cros_settings_names.h" | 95 #include "chromeos/settings/cros_settings_names.h" |
| 96 #endif // defined(OS_CHROMEOS) | 96 #endif // defined(OS_CHROMEOS) |
| 97 | 97 |
| 98 #if defined(USE_NSS) |
| 99 #include "chrome/browser/ui/crypto_module_password_dialog.h" |
| 100 #endif |
| 101 |
| 98 using content::BrowserContext; | 102 using content::BrowserContext; |
| 99 using content::BrowserThread; | 103 using content::BrowserThread; |
| 100 using content::ResourceContext; | 104 using content::ResourceContext; |
| 101 | 105 |
| 102 namespace { | 106 namespace { |
| 103 | 107 |
| 104 // ---------------------------------------------------------------------------- | 108 // ---------------------------------------------------------------------------- |
| 105 // CookieMonster::Delegate implementation | 109 // CookieMonster::Delegate implementation |
| 106 // ---------------------------------------------------------------------------- | 110 // ---------------------------------------------------------------------------- |
| 107 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 111 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 return host_resolver_; | 674 return host_resolver_; |
| 671 } | 675 } |
| 672 | 676 |
| 673 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { | 677 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { |
| 674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 678 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 675 DCHECK(io_data_->initialized_); | 679 DCHECK(io_data_->initialized_); |
| 676 return request_context_; | 680 return request_context_; |
| 677 } | 681 } |
| 678 | 682 |
| 679 scoped_ptr<net::ClientCertStore> | 683 scoped_ptr<net::ClientCertStore> |
| 680 ProfileIOData::ResourceContext::CreateClientCertStore() { | 684 ProfileIOData::ResourceContext::CreateClientCertStore( |
| 685 const std::string& host_and_port) { |
| 681 #if !defined(USE_OPENSSL) | 686 #if !defined(USE_OPENSSL) |
| 682 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreImpl()); | 687 scoped_ptr<net::ClientCertStoreImpl> store(new net::ClientCertStoreImpl()); |
| 683 #else | 688 #if defined(USE_NSS) |
| 689 store->set_password_delegate(chrome::NewCryptoModuleBlockingDialogDelegate( |
| 690 chrome::kCryptoModulePasswordClientAuth, host_and_port)); |
| 691 #endif |
| 692 return store.PassAs<net::ClientCertStore>(); |
| 693 #else // defined(USE_OPENSSL) |
| 684 // OpenSSL does not use the ClientCertStore infrastructure. On Android client | 694 // OpenSSL does not use the ClientCertStore infrastructure. On Android client |
| 685 // cert matching is done by the OS as part of the call to show the cert | 695 // cert matching is done by the OS as part of the call to show the cert |
| 686 // selection dialog. | 696 // selection dialog. |
| 687 return scoped_ptr<net::ClientCertStore>(); | 697 return scoped_ptr<net::ClientCertStore>(); |
| 688 #endif | 698 #endif |
| 689 } | 699 } |
| 690 | 700 |
| 691 bool ProfileIOData::ResourceContext::AllowMicAccess(const GURL& origin) { | 701 bool ProfileIOData::ResourceContext::AllowMicAccess(const GURL& origin) { |
| 692 return AllowContentAccess(origin, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); | 702 return AllowContentAccess(origin, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); |
| 693 } | 703 } |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 void ProfileIOData::SetCookieSettingsForTesting( | 970 void ProfileIOData::SetCookieSettingsForTesting( |
| 961 CookieSettings* cookie_settings) { | 971 CookieSettings* cookie_settings) { |
| 962 DCHECK(!cookie_settings_.get()); | 972 DCHECK(!cookie_settings_.get()); |
| 963 cookie_settings_ = cookie_settings; | 973 cookie_settings_ = cookie_settings; |
| 964 } | 974 } |
| 965 | 975 |
| 966 void ProfileIOData::set_signin_names_for_testing( | 976 void ProfileIOData::set_signin_names_for_testing( |
| 967 SigninNamesOnIOThread* signin_names) { | 977 SigninNamesOnIOThread* signin_names) { |
| 968 signin_names_.reset(signin_names); | 978 signin_names_.reset(signin_names); |
| 969 } | 979 } |
| OLD | NEW |