| 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 <shlobj.h> | 5 #include <shlobj.h> |
| 6 #include <wtsapi32.h> | 6 #include <wtsapi32.h> |
| 7 #pragma comment(lib, "wtsapi32.lib") | 7 #pragma comment(lib, "wtsapi32.lib") |
| 8 | 8 |
| 9 #include "chrome/browser/policy/policy_path_parser.h" | 9 #include "chrome/browser/policy/policy_path_parser.h" |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // provided on the command line must be preserved since it is specific to | 147 // provided on the command line must be preserved since it is specific to |
| 148 // CF's host. | 148 // CF's host. |
| 149 base::FilePath cf_host_dir; | 149 base::FilePath cf_host_dir; |
| 150 if (is_chrome_frame) | 150 if (is_chrome_frame) |
| 151 cf_host_dir = user_data_dir->BaseName(); | 151 cf_host_dir = user_data_dir->BaseName(); |
| 152 | 152 |
| 153 // Policy from the HKLM hive has precedence over HKCU so if we have one here | 153 // Policy from the HKLM hive has precedence over HKCU so if we have one here |
| 154 // we don't have to try to load HKCU. | 154 // we don't have to try to load HKCU. |
| 155 const char* key_name_ascii = (is_chrome_frame ? policy::key::kGCFUserDataDir : | 155 const char* key_name_ascii = (is_chrome_frame ? policy::key::kGCFUserDataDir : |
| 156 policy::key::kUserDataDir); | 156 policy::key::kUserDataDir); |
| 157 std::wstring key_name(ASCIIToWide(key_name_ascii)); | 157 std::wstring key_name(base::ASCIIToWide(key_name_ascii)); |
| 158 if (LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, key_name, | 158 if (LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, key_name, |
| 159 user_data_dir) || | 159 user_data_dir) || |
| 160 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, key_name, | 160 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, key_name, |
| 161 user_data_dir)) { | 161 user_data_dir)) { |
| 162 // A Group Policy value was loaded. Append the Chrome Frame host directory | 162 // A Group Policy value was loaded. Append the Chrome Frame host directory |
| 163 // if relevant. | 163 // if relevant. |
| 164 if (is_chrome_frame) | 164 if (is_chrome_frame) |
| 165 *user_data_dir = user_data_dir->Append(cf_host_dir); | 165 *user_data_dir = user_data_dir->Append(cf_host_dir); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace path_parser | 169 } // namespace path_parser |
| 170 | 170 |
| 171 } // namespace policy | 171 } // namespace policy |
| OLD | NEW |