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 | |
6 #include <windows.h> | 5 #include <windows.h> |
7 #include <shlobj.h> | 6 #include <shlobj.h> |
8 | 7 |
9 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
10 #include "base/file_util.h" | |
11 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
12 #include "base/path_service.h" | 10 #include "base/path_service.h" |
13 #include "base/win/scoped_co_mem.h" | 11 #include "base/win/scoped_co_mem.h" |
14 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
15 | 13 |
16 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 14 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
17 extern "C" IMAGE_DOS_HEADER __ImageBase; | 15 extern "C" IMAGE_DOS_HEADER __ImageBase; |
18 | 16 |
19 using base::FilePath; | 17 using base::FilePath; |
20 | 18 |
(...skipping 25 matching lines...) Expand all Loading... |
46 *result = result->AppendASCII("Internet Explorer"); | 44 *result = result->AppendASCII("Internet Explorer"); |
47 *result = result->AppendASCII("Quick Launch"); | 45 *result = result->AppendASCII("Quick Launch"); |
48 return true; | 46 return true; |
49 } | 47 } |
50 | 48 |
51 } // namespace | 49 } // namespace |
52 | 50 |
53 namespace base { | 51 namespace base { |
54 | 52 |
55 bool PathProviderWin(int key, FilePath* result) { | 53 bool PathProviderWin(int key, FilePath* result) { |
56 | |
57 // We need to go compute the value. It would be nice to support paths with | 54 // We need to go compute the value. It would be nice to support paths with |
58 // names longer than MAX_PATH, but the system functions don't seem to be | 55 // names longer than MAX_PATH, but the system functions don't seem to be |
59 // designed for it either, with the exception of GetTempPath (but other | 56 // designed for it either, with the exception of GetTempPath (but other |
60 // things will surely break if the temp path is too long, so we don't bother | 57 // things will surely break if the temp path is too long, so we don't bother |
61 // handling it. | 58 // handling it. |
62 wchar_t system_buffer[MAX_PATH]; | 59 wchar_t system_buffer[MAX_PATH]; |
63 system_buffer[0] = 0; | 60 system_buffer[0] = 0; |
64 | 61 |
65 FilePath cur; | 62 FilePath cur; |
66 switch (key) { | 63 switch (key) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 break; | 199 break; |
203 default: | 200 default: |
204 return false; | 201 return false; |
205 } | 202 } |
206 | 203 |
207 *result = cur; | 204 *result = cur; |
208 return true; | 205 return true; |
209 } | 206 } |
210 | 207 |
211 } // namespace base | 208 } // namespace base |
OLD | NEW |