cros: Update SAML flow.
[chromium-blink-merge.git] / chromeos / chromeos_paths.cc
blob25174d45ddd1a3f534aa46bafad46209ed7767e6
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromeos/chromeos_paths.h"
7 #include "base/files/file_path.h"
8 #include "base/path_service.h"
10 namespace chromeos {
12 namespace {
14 const base::FilePath::CharType kDefaultAppOrderFileName[] =
15 #if defined(GOOGLE_CHROME_BUILD)
16 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json");
17 #else
18 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json");
19 #endif // defined(GOOGLE_CHROME_BUILD)
21 const base::FilePath::CharType kDefaultUserPolicyKeysDir[] =
22 FILE_PATH_LITERAL("/var/run/user_policy");
24 const base::FilePath::CharType kOwnerKeyFileName[] =
25 FILE_PATH_LITERAL("/var/lib/whitelist/owner.key");
27 const base::FilePath::CharType kInstallAttributesFileName[] =
28 FILE_PATH_LITERAL("/var/run/lockbox/install_attributes.pb");
30 const base::FilePath::CharType kUptimeFileName[] =
31 FILE_PATH_LITERAL("/proc/uptime");
33 const base::FilePath::CharType kUpdateRebootNeededUptimeFile[] =
34 FILE_PATH_LITERAL("/var/run/chrome/update_reboot_needed_uptime");
36 const base::FilePath::CharType kDeviceLocalAccountExtensionDir[] =
37 FILE_PATH_LITERAL("/var/cache/device_local_account_extensions");
39 const base::FilePath::CharType kDeviceLocalAccountExternalDataDir[] =
40 FILE_PATH_LITERAL("/var/cache/device_local_account_external_policy_data");
42 bool PathProvider(int key, base::FilePath* result) {
43 switch (key) {
44 case FILE_DEFAULT_APP_ORDER:
45 *result = base::FilePath(kDefaultAppOrderFileName);
46 break;
47 case DIR_USER_POLICY_KEYS:
48 *result = base::FilePath(kDefaultUserPolicyKeysDir);
49 break;
50 case FILE_OWNER_KEY:
51 *result = base::FilePath(kOwnerKeyFileName);
52 break;
53 case FILE_INSTALL_ATTRIBUTES:
54 *result = base::FilePath(kInstallAttributesFileName);
55 break;
56 case FILE_UPTIME:
57 *result = base::FilePath(kUptimeFileName);
58 break;
59 case FILE_UPDATE_REBOOT_NEEDED_UPTIME:
60 *result = base::FilePath(kUpdateRebootNeededUptimeFile);
61 break;
62 case DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS:
63 *result = base::FilePath(kDeviceLocalAccountExtensionDir);
64 break;
65 case DIR_DEVICE_LOCAL_ACCOUNT_EXTERNAL_DATA:
66 *result = base::FilePath(kDeviceLocalAccountExternalDataDir);
67 break;
68 default:
69 return false;
71 return true;
74 } // namespace
76 void RegisterPathProvider() {
77 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
80 } // namespace chromeos