| 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/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // The crash reports are always stored relative to the default user data | 200 // The crash reports are always stored relative to the default user data |
| 201 // directory. This avoids the problem of having to re-initialize the | 201 // directory. This avoids the problem of having to re-initialize the |
| 202 // exception handler after parsing command line options, which may | 202 // exception handler after parsing command line options, which may |
| 203 // override the location of the app's profile directory. | 203 // override the location of the app's profile directory. |
| 204 if (!GetDefaultUserDataDirectory(&cur)) | 204 if (!GetDefaultUserDataDirectory(&cur)) |
| 205 return false; | 205 return false; |
| 206 #endif | 206 #endif |
| 207 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); | 207 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); |
| 208 create_dir = true; | 208 create_dir = true; |
| 209 break; | 209 break; |
| 210 #if defined(OS_WIN) |
| 211 case chrome::DIR_WATCHER_DATA: |
| 212 // The watcher data is always stored relative to the default user data |
| 213 // directory. This allows the watcher to be initialized before |
| 214 // command-line options have been parsed. |
| 215 if (!GetDefaultUserDataDirectory(&cur)) |
| 216 return false; |
| 217 cur = cur.Append(FILE_PATH_LITERAL("Diagnostics")); |
| 218 break; |
| 219 #endif |
| 210 case chrome::DIR_RESOURCES: | 220 case chrome::DIR_RESOURCES: |
| 211 #if defined(OS_MACOSX) | 221 #if defined(OS_MACOSX) |
| 212 cur = base::mac::FrameworkBundlePath(); | 222 cur = base::mac::FrameworkBundlePath(); |
| 213 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | 223 cur = cur.Append(FILE_PATH_LITERAL("Resources")); |
| 214 #else | 224 #else |
| 215 if (!PathService::Get(chrome::DIR_APP, &cur)) | 225 if (!PathService::Get(chrome::DIR_APP, &cur)) |
| 216 return false; | 226 return false; |
| 217 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 227 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
| 218 #endif | 228 #endif |
| 219 break; | 229 break; |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 582 |
| 573 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 583 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
| 574 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 584 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
| 575 } | 585 } |
| 576 | 586 |
| 577 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 587 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
| 578 return g_invalid_specified_user_data_dir.Get(); | 588 return g_invalid_specified_user_data_dir.Get(); |
| 579 } | 589 } |
| 580 | 590 |
| 581 } // namespace chrome | 591 } // namespace chrome |
| OLD | NEW |