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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // The crash reports are always stored relative to the default user data | 210 // The crash reports are always stored relative to the default user data |
211 // directory. This avoids the problem of having to re-initialize the | 211 // directory. This avoids the problem of having to re-initialize the |
212 // exception handler after parsing command line options, which may | 212 // exception handler after parsing command line options, which may |
213 // override the location of the app's profile directory. | 213 // override the location of the app's profile directory. |
214 if (!GetDefaultUserDataDirectory(&cur)) | 214 if (!GetDefaultUserDataDirectory(&cur)) |
215 return false; | 215 return false; |
216 #endif | 216 #endif |
217 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); | 217 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); |
218 create_dir = true; | 218 create_dir = true; |
219 break; | 219 break; |
| 220 #if defined(OS_WIN) |
| 221 case chrome::DIR_WATCHER_DATA: |
| 222 // The watcher data is always stored relative to the default user data |
| 223 // directory. This allows the watcher to be initialized before |
| 224 // command-line options have been parsed. |
| 225 if (!GetDefaultUserDataDirectory(&cur)) |
| 226 return false; |
| 227 cur = cur.Append(FILE_PATH_LITERAL("Diagnostics")); |
| 228 break; |
| 229 #endif |
220 case chrome::DIR_RESOURCES: | 230 case chrome::DIR_RESOURCES: |
221 #if defined(OS_MACOSX) | 231 #if defined(OS_MACOSX) |
222 cur = base::mac::FrameworkBundlePath(); | 232 cur = base::mac::FrameworkBundlePath(); |
223 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | 233 cur = cur.Append(FILE_PATH_LITERAL("Resources")); |
224 #else | 234 #else |
225 if (!PathService::Get(chrome::DIR_APP, &cur)) | 235 if (!PathService::Get(chrome::DIR_APP, &cur)) |
226 return false; | 236 return false; |
227 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 237 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
228 #endif | 238 #endif |
229 break; | 239 break; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 597 |
588 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 598 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
589 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 599 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
590 } | 600 } |
591 | 601 |
592 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 602 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
593 return g_invalid_specified_user_data_dir.Get(); | 603 return g_invalid_specified_user_data_dir.Get(); |
594 } | 604 } |
595 | 605 |
596 } // namespace chrome | 606 } // namespace chrome |
OLD | NEW |