| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 return false; | 452 return false; |
| 453 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences")); | 453 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences")); |
| 454 char* login = getlogin(); | 454 char* login = getlogin(); |
| 455 if (!login) | 455 if (!login) |
| 456 return false; | 456 return false; |
| 457 cur = cur.AppendASCII(login); | 457 cur = cur.AppendASCII(login); |
| 458 if (!base::PathExists(cur)) // We don't want to create this. | 458 if (!base::PathExists(cur)) // We don't want to create this. |
| 459 return false; | 459 return false; |
| 460 break; | 460 break; |
| 461 } | 461 } |
| 462 case chrome::DIR_USER_LIBRARY: { |
| 463 if (!GetUserLibraryDirectory(&cur)) |
| 464 return false; |
| 465 if (!base::PathExists(cur)) // We don't want to create this. |
| 466 return false; |
| 467 break; |
| 468 } |
| 469 case chrome::DIR_USER_APPLICATIONS: { |
| 470 if (!GetUserApplicationsDirectory(&cur)) |
| 471 return false; |
| 472 if (!base::PathExists(cur)) // We don't want to create this. |
| 473 return false; |
| 474 break; |
| 475 } |
| 462 #endif | 476 #endif |
| 463 #if defined(OS_CHROMEOS) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 477 #if defined(OS_CHROMEOS) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 464 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 478 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
| 465 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 479 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 466 return false; | 480 return false; |
| 467 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 481 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
| 468 break; | 482 break; |
| 469 } | 483 } |
| 470 #endif | 484 #endif |
| 471 #if defined(OS_LINUX) | 485 #if defined(OS_LINUX) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 return true; | 559 return true; |
| 546 } | 560 } |
| 547 | 561 |
| 548 // This cannot be done as a static initializer sadly since Visual Studio will | 562 // This cannot be done as a static initializer sadly since Visual Studio will |
| 549 // eliminate this object file if there is no direct entry point into it. | 563 // eliminate this object file if there is no direct entry point into it. |
| 550 void RegisterPathProvider() { | 564 void RegisterPathProvider() { |
| 551 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 565 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 552 } | 566 } |
| 553 | 567 |
| 554 } // namespace chrome | 568 } // namespace chrome |
| OLD | NEW |