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 "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 open_folder_and_select_itemsPtr = | 66 open_folder_and_select_itemsPtr = |
67 reinterpret_cast<SHOpenFolderAndSelectItemsFuncPtr> | 67 reinterpret_cast<SHOpenFolderAndSelectItemsFuncPtr> |
68 (GetProcAddress(shell32_base, "SHOpenFolderAndSelectItems")); | 68 (GetProcAddress(shell32_base, "SHOpenFolderAndSelectItems")); |
69 } | 69 } |
70 if (!open_folder_and_select_itemsPtr) { | 70 if (!open_folder_and_select_itemsPtr) { |
71 ShellExecute(NULL, L"open", dir.value().c_str(), NULL, NULL, SW_SHOW); | 71 ShellExecute(NULL, L"open", dir.value().c_str(), NULL, NULL, SW_SHOW); |
72 return; | 72 return; |
73 } | 73 } |
74 | 74 |
75 base::win::ScopedComPtr<IShellFolder> desktop; | 75 base::win::ScopedComPtr<IShellFolder> desktop; |
76 HRESULT hr = SHGetDesktopFolder(desktop.Receive()); | 76 HRESULT hr = SHGetDesktopFolder(desktop.GetAddressOf()); |
77 if (FAILED(hr)) | 77 if (FAILED(hr)) |
78 return; | 78 return; |
79 | 79 |
80 base::win::ScopedCoMem<ITEMIDLIST> dir_item; | 80 base::win::ScopedCoMem<ITEMIDLIST> dir_item; |
81 hr = desktop->ParseDisplayName(NULL, NULL, | 81 hr = desktop->ParseDisplayName(NULL, NULL, |
82 const_cast<wchar_t *>(dir.value().c_str()), | 82 const_cast<wchar_t *>(dir.value().c_str()), |
83 NULL, &dir_item, NULL); | 83 NULL, &dir_item, NULL); |
84 if (FAILED(hr)) | 84 if (FAILED(hr)) |
85 return; | 85 return; |
86 | 86 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } // namespace internal | 183 } // namespace internal |
184 | 184 |
185 void OpenExternal(Profile* profile, const GURL& url) { | 185 void OpenExternal(Profile* profile, const GURL& url) { |
186 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 186 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
187 | 187 |
188 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 188 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
189 base::Bind(&OpenExternalOnFileThread, url)); | 189 base::Bind(&OpenExternalOnFileThread, url)); |
190 } | 190 } |
191 | 191 |
192 } // namespace platform_util | 192 } // namespace platform_util |
OLD | NEW |