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 #include "chrome/common/chrome_paths.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // The crash reports are always stored relative to the default user data | 201 // The crash reports are always stored relative to the default user data |
202 // directory. This avoids the problem of having to re-initialize the | 202 // directory. This avoids the problem of having to re-initialize the |
203 // exception handler after parsing command line options, which may | 203 // exception handler after parsing command line options, which may |
204 // override the location of the app's profile directory. | 204 // override the location of the app's profile directory. |
205 if (!GetDefaultUserDataDirectory(&cur)) | 205 if (!GetDefaultUserDataDirectory(&cur)) |
206 return false; | 206 return false; |
207 #endif | 207 #endif |
208 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); | 208 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); |
209 create_dir = true; | 209 create_dir = true; |
210 break; | 210 break; |
| 211 case chrome::DIR_USER_DESKTOP: |
| 212 if (!GetUserDesktop(&cur)) |
| 213 return false; |
| 214 break; |
211 case chrome::DIR_RESOURCES: | 215 case chrome::DIR_RESOURCES: |
212 #if defined(OS_MACOSX) | 216 #if defined(OS_MACOSX) |
213 cur = base::mac::FrameworkBundlePath(); | 217 cur = base::mac::FrameworkBundlePath(); |
214 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | 218 cur = cur.Append(FILE_PATH_LITERAL("Resources")); |
215 #else | 219 #else |
216 if (!PathService::Get(chrome::DIR_APP, &cur)) | 220 if (!PathService::Get(chrome::DIR_APP, &cur)) |
217 return false; | 221 return false; |
218 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 222 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
219 #endif | 223 #endif |
220 break; | 224 break; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 return true; | 463 return true; |
460 } | 464 } |
461 | 465 |
462 // This cannot be done as a static initializer sadly since Visual Studio will | 466 // This cannot be done as a static initializer sadly since Visual Studio will |
463 // eliminate this object file if there is no direct entry point into it. | 467 // eliminate this object file if there is no direct entry point into it. |
464 void RegisterPathProvider() { | 468 void RegisterPathProvider() { |
465 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 469 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
466 } | 470 } |
467 | 471 |
468 } // namespace chrome | 472 } // namespace chrome |
OLD | NEW |