| 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 #include "net/http/url_security_manager.h" | 5 #include "net/http/url_security_manager.h" |
| 6 | 6 |
| 7 #include <urlmon.h> | 7 #include <urlmon.h> |
| 8 #pragma comment(lib, "urlmon.lib") | 8 #pragma comment(lib, "urlmon.lib") |
| 9 | 9 |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 URLSecurityManagerWin::URLSecurityManagerWin( | 46 URLSecurityManagerWin::URLSecurityManagerWin( |
| 47 const HttpAuthFilter* whitelist_delegate) | 47 const HttpAuthFilter* whitelist_delegate) |
| 48 : whitelist_delegate_(whitelist_delegate) { | 48 : whitelist_delegate_(whitelist_delegate) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool URLSecurityManagerWin::CanUseDefaultCredentials( | 51 bool URLSecurityManagerWin::CanUseDefaultCredentials( |
| 52 const GURL& auth_origin) const { | 52 const GURL& auth_origin) const { |
| 53 if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager()) | 53 if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager()) |
| 54 return false; | 54 return false; |
| 55 | 55 |
| 56 std::wstring url_w = ASCIIToWide(auth_origin.spec()); | 56 std::wstring url_w = base::ASCIIToWide(auth_origin.spec()); |
| 57 DWORD policy = 0; | 57 DWORD policy = 0; |
| 58 HRESULT hr; | 58 HRESULT hr; |
| 59 hr = security_manager_->ProcessUrlAction(url_w.c_str(), | 59 hr = security_manager_->ProcessUrlAction(url_w.c_str(), |
| 60 URLACTION_CREDENTIALS_USE, | 60 URLACTION_CREDENTIALS_USE, |
| 61 reinterpret_cast<BYTE*>(&policy), | 61 reinterpret_cast<BYTE*>(&policy), |
| 62 sizeof(policy), NULL, 0, | 62 sizeof(policy), NULL, 0, |
| 63 PUAF_NOUI, 0); | 63 PUAF_NOUI, 0); |
| 64 if (FAILED(hr)) { | 64 if (FAILED(hr)) { |
| 65 LOG(ERROR) << "IInternetSecurityManager::ProcessUrlAction failed: " << hr; | 65 LOG(ERROR) << "IInternetSecurityManager::ProcessUrlAction failed: " << hr; |
| 66 return false; | 66 return false; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const HttpAuthFilter* whitelist_default, | 128 const HttpAuthFilter* whitelist_default, |
| 129 const HttpAuthFilter* whitelist_delegate) { | 129 const HttpAuthFilter* whitelist_delegate) { |
| 130 // If we have a whitelist, just use that. | 130 // If we have a whitelist, just use that. |
| 131 if (whitelist_default) | 131 if (whitelist_default) |
| 132 return new URLSecurityManagerWhitelist(whitelist_default, | 132 return new URLSecurityManagerWhitelist(whitelist_default, |
| 133 whitelist_delegate); | 133 whitelist_delegate); |
| 134 return new URLSecurityManagerWin(whitelist_delegate); | 134 return new URLSecurityManagerWin(whitelist_delegate); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace net | 137 } // namespace net |
| OLD | NEW |