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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) | 473 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) |
474 case chrome::DIR_POLICY_FILES: { | 474 case chrome::DIR_POLICY_FILES: { |
475 #if defined(GOOGLE_CHROME_BUILD) | 475 #if defined(GOOGLE_CHROME_BUILD) |
476 cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); | 476 cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); |
477 #else | 477 #else |
478 cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); | 478 cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); |
479 #endif | 479 #endif |
480 break; | 480 break; |
481 } | 481 } |
482 #endif | 482 #endif |
483 #if defined(OS_MACOSX) | |
484 case chrome::DIR_USER_LIBRARY: { | |
485 if (!GetUserLibraryDirectory(&cur)) | |
486 return false; | |
487 if (!base::PathExists(cur)) // We don't want to create this. | |
488 return false; | |
489 break; | |
490 } | |
491 case chrome::DIR_USER_APPLICATIONS: { | |
492 if (!GetUserApplicationsDirectory(&cur)) | |
493 return false; | |
494 if (!base::PathExists(cur)) // We don't want to create this. | |
495 return false; | |
496 break; | |
497 } | |
498 #endif | |
499 #if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(CHROMIUM_BUILD)) || \ | 483 #if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(CHROMIUM_BUILD)) || \ |
500 defined(OS_MACOSX) | 484 defined(OS_MACOSX) |
501 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 485 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
502 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 486 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
503 return false; | 487 return false; |
504 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 488 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
505 break; | 489 break; |
506 } | 490 } |
507 #endif | 491 #endif |
508 #if defined(OS_LINUX) | 492 #if defined(OS_LINUX) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 590 |
607 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 591 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
608 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 592 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
609 } | 593 } |
610 | 594 |
611 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 595 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
612 return g_invalid_specified_user_data_dir.Get(); | 596 return g_invalid_specified_user_data_dir.Get(); |
613 } | 597 } |
614 | 598 |
615 } // namespace chrome | 599 } // namespace chrome |
OLD | NEW |