OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/policy/policy_path_parser.h" | 5 #include "chrome/browser/policy/policy_path_parser.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <wtsapi32.h> | 9 #include <wtsapi32.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/win/registry.h" | 15 #include "base/win/registry.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "policy/policy_constants.h" | 17 #include "components/policy/policy_constants.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Checks if the key exists in the given hive and expands any string variables. | 21 // Checks if the key exists in the given hive and expands any string variables. |
22 bool LoadUserDataDirPolicyFromRegistry(HKEY hive, | 22 bool LoadUserDataDirPolicyFromRegistry(HKEY hive, |
23 const char* key_name_str, | 23 const char* key_name_str, |
24 base::FilePath* dir) { | 24 base::FilePath* dir) { |
25 base::string16 value; | 25 base::string16 value; |
26 base::string16 key_name(base::ASCIIToUTF16(key_name_str)); | 26 base::string16 key_name(base::ASCIIToUTF16(key_name_str)); |
27 base::win::RegKey key(hive, policy::kRegistryChromePolicyKey, KEY_READ); | 27 base::win::RegKey key(hive, policy::kRegistryChromePolicyKey, KEY_READ); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (!LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, key::kDiskCacheDir, | 161 if (!LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, key::kDiskCacheDir, |
162 disk_cache_dir)) { | 162 disk_cache_dir)) { |
163 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, key::kDiskCacheDir, | 163 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, key::kDiskCacheDir, |
164 disk_cache_dir); | 164 disk_cache_dir); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } // namespace path_parser | 168 } // namespace path_parser |
169 | 169 |
170 } // namespace policy | 170 } // namespace policy |
OLD | NEW |