Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: base/base_paths_win.cc

Issue 159833003: Add support for GetHomeDir for Mac and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include <windows.h> 5 #include <windows.h>
6 #include <shlobj.h> 6 #include <shlobj.h>
7 7
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 system_buffer))) 120 system_buffer)))
121 return false; 121 return false;
122 cur = FilePath(system_buffer); 122 cur = FilePath(system_buffer);
123 break; 123 break;
124 case base::DIR_COMMON_APP_DATA: 124 case base::DIR_COMMON_APP_DATA:
125 if (FAILED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 125 if (FAILED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL,
126 SHGFP_TYPE_CURRENT, system_buffer))) 126 SHGFP_TYPE_CURRENT, system_buffer)))
127 return false; 127 return false;
128 cur = FilePath(system_buffer); 128 cur = FilePath(system_buffer);
129 break; 129 break;
130 case base::DIR_PROFILE:
131 if (FAILED(SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT,
132 system_buffer)))
133 return false;
134 cur = FilePath(system_buffer);
135 break;
136 case base::DIR_LOCAL_APP_DATA_LOW: 130 case base::DIR_LOCAL_APP_DATA_LOW:
137 if (win::GetVersion() < win::VERSION_VISTA) 131 if (win::GetVersion() < win::VERSION_VISTA)
138 return false; 132 return false;
139 133
140 // TODO(nsylvain): We should use SHGetKnownFolderPath instead. Bug 1281128 134 // TODO(nsylvain): We should use SHGetKnownFolderPath instead. Bug 1281128
141 if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, 135 if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT,
142 system_buffer))) 136 system_buffer)))
143 return false; 137 return false;
144 cur = FilePath(system_buffer).DirName().AppendASCII("LocalLow"); 138 cur = FilePath(system_buffer).DirName().AppendASCII("LocalLow");
145 break; 139 break;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 break; 193 break;
200 default: 194 default:
201 return false; 195 return false;
202 } 196 }
203 197
204 *result = cur; 198 *result = cur;
205 return true; 199 return true;
206 } 200 }
207 201
208 } // namespace base 202 } // namespace base
OLDNEW
« no previous file with comments | « base/base_paths_win.h ('k') | base/file_util.h » ('j') | base/file_util_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698