Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: chromeos/chromeos_paths.cc

Issue 341043005: Wire up component cloud policy to device local accounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« chromeos/chromeos_paths.h ('K') | « chromeos/chromeos_paths.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 "chromeos/chromeos_paths.h" 5 #include "chromeos/chromeos_paths.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 23 matching lines...) Expand all
34 34
35 const base::FilePath::CharType kUpdateRebootNeededUptimeFile[] = 35 const base::FilePath::CharType kUpdateRebootNeededUptimeFile[] =
36 FILE_PATH_LITERAL("/var/run/chrome/update_reboot_needed_uptime"); 36 FILE_PATH_LITERAL("/var/run/chrome/update_reboot_needed_uptime");
37 37
38 const base::FilePath::CharType kDeviceLocalAccountExtensionDir[] = 38 const base::FilePath::CharType kDeviceLocalAccountExtensionDir[] =
39 FILE_PATH_LITERAL("/var/cache/device_local_account_extensions"); 39 FILE_PATH_LITERAL("/var/cache/device_local_account_extensions");
40 40
41 const base::FilePath::CharType kDeviceLocalAccountExternalDataDir[] = 41 const base::FilePath::CharType kDeviceLocalAccountExternalDataDir[] =
42 FILE_PATH_LITERAL("/var/cache/device_local_account_external_policy_data"); 42 FILE_PATH_LITERAL("/var/cache/device_local_account_external_policy_data");
43 43
44 const base::FilePath::CharType kDeviceLocalAccountComponentPolicy[] =
45 FILE_PATH_LITERAL("/var/cache/device_local_account_component_policy");
46
44 bool PathProvider(int key, base::FilePath* result) { 47 bool PathProvider(int key, base::FilePath* result) {
45 switch (key) { 48 switch (key) {
46 case FILE_DEFAULT_APP_ORDER: 49 case FILE_DEFAULT_APP_ORDER:
47 *result = base::FilePath(kDefaultAppOrderFileName); 50 *result = base::FilePath(kDefaultAppOrderFileName);
48 break; 51 break;
49 case DIR_USER_POLICY_KEYS: 52 case DIR_USER_POLICY_KEYS:
50 *result = base::FilePath(kDefaultUserPolicyKeysDir); 53 *result = base::FilePath(kDefaultUserPolicyKeysDir);
51 break; 54 break;
52 case FILE_OWNER_KEY: 55 case FILE_OWNER_KEY:
53 *result = base::FilePath(kOwnerKeyFileName); 56 *result = base::FilePath(kOwnerKeyFileName);
54 break; 57 break;
55 case FILE_INSTALL_ATTRIBUTES: 58 case FILE_INSTALL_ATTRIBUTES:
56 *result = base::FilePath(kInstallAttributesFileName); 59 *result = base::FilePath(kInstallAttributesFileName);
57 break; 60 break;
58 case FILE_UPTIME: 61 case FILE_UPTIME:
59 *result = base::FilePath(kUptimeFileName); 62 *result = base::FilePath(kUptimeFileName);
60 break; 63 break;
61 case FILE_UPDATE_REBOOT_NEEDED_UPTIME: 64 case FILE_UPDATE_REBOOT_NEEDED_UPTIME:
62 *result = base::FilePath(kUpdateRebootNeededUptimeFile); 65 *result = base::FilePath(kUpdateRebootNeededUptimeFile);
63 break; 66 break;
64 case DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS: 67 case DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS:
65 *result = base::FilePath(kDeviceLocalAccountExtensionDir); 68 *result = base::FilePath(kDeviceLocalAccountExtensionDir);
66 break; 69 break;
67 case DIR_DEVICE_LOCAL_ACCOUNT_EXTERNAL_DATA: 70 case DIR_DEVICE_LOCAL_ACCOUNT_EXTERNAL_DATA:
68 *result = base::FilePath(kDeviceLocalAccountExternalDataDir); 71 *result = base::FilePath(kDeviceLocalAccountExternalDataDir);
69 break; 72 break;
73 case DIR_DEVICE_LOCAL_ACCOUNT_COMPONENT_POLICY:
74 *result = base::FilePath(kDeviceLocalAccountComponentPolicy);
75 break;
70 default: 76 default:
71 return false; 77 return false;
72 } 78 }
73 return true; 79 return true;
74 } 80 }
75 81
76 } // namespace 82 } // namespace
77 83
78 void RegisterPathProvider() { 84 void RegisterPathProvider() {
79 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 85 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
(...skipping 12 matching lines...) Expand all
92 PathService::OverrideAndCreateIfNeeded( 98 PathService::OverrideAndCreateIfNeeded(
93 FILE_OWNER_KEY, 99 FILE_OWNER_KEY,
94 parent.AppendASCII("stub_owner.key"), 100 parent.AppendASCII("stub_owner.key"),
95 is_absolute, 101 is_absolute,
96 create); 102 create);
97 PathService::OverrideAndCreateIfNeeded( 103 PathService::OverrideAndCreateIfNeeded(
98 FILE_INSTALL_ATTRIBUTES, 104 FILE_INSTALL_ATTRIBUTES,
99 parent.AppendASCII("stub_install_attributes.pb"), 105 parent.AppendASCII("stub_install_attributes.pb"),
100 is_absolute, 106 is_absolute,
101 create); 107 create);
108 PathService::Override(
109 DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS,
110 parent.AppendASCII("stub_device_local_account_extensions"));
111 PathService::Override(
112 DIR_DEVICE_LOCAL_ACCOUNT_EXTERNAL_DATA,
113 parent.AppendASCII("stub_device_local_account_external_data"));
114 PathService::Override(
115 DIR_DEVICE_LOCAL_ACCOUNT_COMPONENT_POLICY,
116 parent.AppendASCII("stub_device_local_account_component_policy"));
102 } 117 }
103 118
104 } // namespace chromeos 119 } // namespace chromeos
OLDNEW
« chromeos/chromeos_paths.h ('K') | « chromeos/chromeos_paths.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698