| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); | 401 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); |
| 402 break; | 402 break; |
| 403 #endif | 403 #endif |
| 404 #if defined(OS_LINUX) && defined(ENABLE_MANAGED_USERS) | 404 #if defined(OS_LINUX) && defined(ENABLE_MANAGED_USERS) |
| 405 case chrome::DIR_MANAGED_USERS_DEFAULT_APPS: | 405 case chrome::DIR_MANAGED_USERS_DEFAULT_APPS: |
| 406 if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur)) | 406 if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur)) |
| 407 return false; | 407 return false; |
| 408 cur = cur.Append(FILE_PATH_LITERAL("managed_users")); | 408 cur = cur.Append(FILE_PATH_LITERAL("managed_users")); |
| 409 break; | 409 break; |
| 410 #endif | 410 #endif |
| 411 case chrome::FILE_LIBADDRESSINPUT_CACHE: |
| 412 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 413 return false; |
| 414 cur = cur.Append(FILE_PATH_LITERAL("libaddressinput")); |
| 415 break; |
| 411 // The following are only valid in the development environment, and | 416 // The following are only valid in the development environment, and |
| 412 // will fail if executed from an installed executable (because the | 417 // will fail if executed from an installed executable (because the |
| 413 // generated path won't exist). | 418 // generated path won't exist). |
| 414 case chrome::DIR_GEN_TEST_DATA: | 419 case chrome::DIR_GEN_TEST_DATA: |
| 415 if (!PathService::Get(base::DIR_MODULE, &cur)) | 420 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 416 return false; | 421 return false; |
| 417 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 422 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
| 418 if (!base::PathExists(cur)) // We don't want to create this. | 423 if (!base::PathExists(cur)) // We don't want to create this. |
| 419 return false; | 424 return false; |
| 420 break; | 425 break; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 return true; | 550 return true; |
| 546 } | 551 } |
| 547 | 552 |
| 548 // This cannot be done as a static initializer sadly since Visual Studio will | 553 // 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. | 554 // eliminate this object file if there is no direct entry point into it. |
| 550 void RegisterPathProvider() { | 555 void RegisterPathProvider() { |
| 551 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 556 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 552 } | 557 } |
| 553 | 558 |
| 554 } // namespace chrome | 559 } // namespace chrome |
| OLD | NEW |