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 | 5 |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/win/scoped_co_mem.h" | 13 #include "base/win/scoped_co_mem.h" |
14 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
15 | 15 |
16 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 16 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
17 extern "C" IMAGE_DOS_HEADER __ImageBase; | 17 extern "C" IMAGE_DOS_HEADER __ImageBase; |
18 | 18 |
| 19 using base::FilePath; |
| 20 |
19 namespace { | 21 namespace { |
20 | 22 |
21 bool GetQuickLaunchPath(bool default_user, FilePath* result) { | 23 bool GetQuickLaunchPath(bool default_user, FilePath* result) { |
22 if (default_user) { | 24 if (default_user) { |
23 wchar_t system_buffer[MAX_PATH]; | 25 wchar_t system_buffer[MAX_PATH]; |
24 system_buffer[0] = 0; | 26 system_buffer[0] = 0; |
25 // As per MSDN, passing -1 for |hToken| indicates the Default user: | 27 // As per MSDN, passing -1 for |hToken| indicates the Default user: |
26 // http://msdn.microsoft.com/library/windows/desktop/bb762181.aspx | 28 // http://msdn.microsoft.com/library/windows/desktop/bb762181.aspx |
27 if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, | 29 if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, |
28 reinterpret_cast<HANDLE>(-1), SHGFP_TYPE_CURRENT, | 30 reinterpret_cast<HANDLE>(-1), SHGFP_TYPE_CURRENT, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 break; | 202 break; |
201 default: | 203 default: |
202 return false; | 204 return false; |
203 } | 205 } |
204 | 206 |
205 *result = cur; | 207 *result = cur; |
206 return true; | 208 return true; |
207 } | 209 } |
208 | 210 |
209 } // namespace base | 211 } // namespace base |
OLD | NEW |