| 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; | |
| 215 case chrome::DIR_RESOURCES: | 211 case chrome::DIR_RESOURCES: |
| 216 #if defined(OS_MACOSX) | 212 #if defined(OS_MACOSX) |
| 217 cur = base::mac::FrameworkBundlePath(); | 213 cur = base::mac::FrameworkBundlePath(); |
| 218 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | 214 cur = cur.Append(FILE_PATH_LITERAL("Resources")); |
| 219 #else | 215 #else |
| 220 if (!PathService::Get(chrome::DIR_APP, &cur)) | 216 if (!PathService::Get(chrome::DIR_APP, &cur)) |
| 221 return false; | 217 return false; |
| 222 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 218 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
| 223 #endif | 219 #endif |
| 224 break; | 220 break; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 return true; | 459 return true; |
| 464 } | 460 } |
| 465 | 461 |
| 466 // This cannot be done as a static initializer sadly since Visual Studio will | 462 // This cannot be done as a static initializer sadly since Visual Studio will |
| 467 // eliminate this object file if there is no direct entry point into it. | 463 // eliminate this object file if there is no direct entry point into it. |
| 468 void RegisterPathProvider() { | 464 void RegisterPathProvider() { |
| 469 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 465 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 470 } | 466 } |
| 471 | 467 |
| 472 } // namespace chrome | 468 } // namespace chrome |
| OLD | NEW |