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 // Most of this code is copied from various classes in | 5 // Most of this code is copied from various classes in |
6 // src/chrome/browser/policy. In particular, look at | 6 // src/chrome/browser/policy. In particular, look at |
7 // | 7 // |
8 // configuration_policy_provider_delegate_win.{h,cc} | 8 // configuration_policy_provider_delegate_win.{h,cc} |
9 // configuration_policy_loader_win.{h,cc} | 9 // configuration_policy_loader_win.{h,cc} |
10 // | 10 // |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 base::DictionaryValue* policy = new base::DictionaryValue(); | 144 base::DictionaryValue* policy = new base::DictionaryValue(); |
145 | 145 |
146 for (int i = 0; i < kBooleanPolicyNamesNum; ++i) { | 146 for (int i = 0; i < kBooleanPolicyNamesNum; ++i) { |
147 const char* policy_name = kBooleanPolicyNames[i]; | 147 const char* policy_name = kBooleanPolicyNames[i]; |
148 bool bool_value; | 148 bool bool_value; |
149 const string16 name(ASCIIToUTF16(policy_name)); | 149 const string16 name(ASCIIToUTF16(policy_name)); |
150 if (GetRegistryPolicyBoolean(name, &bool_value)) { | 150 if (GetRegistryPolicyBoolean(name, &bool_value)) { |
151 policy->SetBoolean(policy_name, bool_value); | 151 policy->SetBoolean(policy_name, bool_value); |
152 } | 152 } |
153 } | 153 } |
| 154 // TODO(simonmorris): Read policies whose names are in kStringPolicyNames. |
154 | 155 |
155 return policy; | 156 return policy; |
156 } | 157 } |
157 | 158 |
158 // Post a reload notification and update the watch machinery. | 159 // Post a reload notification and update the watch machinery. |
159 void Reload() { | 160 void Reload() { |
160 DCHECK(OnPolicyWatcherThread()); | 161 DCHECK(OnPolicyWatcherThread()); |
161 SetupWatches(); | 162 SetupWatches(); |
162 scoped_ptr<DictionaryValue> new_policy(Load()); | 163 scoped_ptr<DictionaryValue> new_policy(Load()); |
163 UpdatePolicies(new_policy.get()); | 164 UpdatePolicies(new_policy.get()); |
(...skipping 17 matching lines...) Expand all Loading... |
181 bool machine_policy_watcher_failed_; | 182 bool machine_policy_watcher_failed_; |
182 }; | 183 }; |
183 | 184 |
184 PolicyWatcher* PolicyWatcher::Create( | 185 PolicyWatcher* PolicyWatcher::Create( |
185 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 186 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
186 return new PolicyWatcherWin(task_runner); | 187 return new PolicyWatcherWin(task_runner); |
187 } | 188 } |
188 | 189 |
189 } // namespace policy_hack | 190 } // namespace policy_hack |
190 } // namespace remoting | 191 } // namespace remoting |
OLD | NEW |