| 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 <shlobj.h> | 5 #include <shlobj.h> |
| 6 #include <shobjidl.h> | 6 #include <shobjidl.h> |
| 7 | 7 |
| 8 #include "content/browser/safe_util_win.h" | 8 #include "content/browser/safe_util_win.h" |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return hr; | 74 return hr; |
| 75 } | 75 } |
| 76 | 76 |
| 77 hr = attachment_services->SetLocalPath(full_path.value().c_str()); | 77 hr = attachment_services->SetLocalPath(full_path.value().c_str()); |
| 78 if (FAILED(hr)) | 78 if (FAILED(hr)) |
| 79 return hr; | 79 return hr; |
| 80 | 80 |
| 81 // Note: SetSource looks like it needs to be called, even if empty. | 81 // Note: SetSource looks like it needs to be called, even if empty. |
| 82 // Docs say it is optional, but it appears not calling it at all sets | 82 // Docs say it is optional, but it appears not calling it at all sets |
| 83 // a zone that is too restrictive. | 83 // a zone that is too restrictive. |
| 84 hr = attachment_services->SetSource(UTF8ToWide(source_url).c_str()); | 84 hr = attachment_services->SetSource(base::UTF8ToWide(source_url).c_str()); |
| 85 if (FAILED(hr)) | 85 if (FAILED(hr)) |
| 86 return hr; | 86 return hr; |
| 87 | 87 |
| 88 // A failure in the Save() call below could result in the downloaded file | 88 // A failure in the Save() call below could result in the downloaded file |
| 89 // being deleted. | 89 // being deleted. |
| 90 return attachment_services->Save(); | 90 return attachment_services->Save(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace content | 93 } // namespace content |
| OLD | NEW |