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 #include "components/policy/core/browser/configuration_policy_pref_store.h" | 5 #include "components/policy/core/browser/configuration_policy_pref_store.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/location.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/message_loop/message_loop.h" | |
13 #include "base/prefs/pref_value_map.h" | 13 #include "base/prefs/pref_value_map.h" |
| 14 #include "base/single_thread_task_runner.h" |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/thread_task_runner_handle.h" |
16 #include "components/policy/core/browser/configuration_policy_handler_list.h" | 18 #include "components/policy/core/browser/configuration_policy_handler_list.h" |
17 #include "components/policy/core/browser/policy_error_map.h" | 19 #include "components/policy/core/browser/policy_error_map.h" |
18 | 20 |
19 namespace policy { | 21 namespace policy { |
20 | 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 // Policies are loaded early on startup, before PolicyErrorMaps are ready to | 25 // Policies are loaded early on startup, before PolicyErrorMaps are ready to |
24 // be retrieved. This function is posted to UI to log any errors found on | 26 // be retrieved. This function is posted to UI to log any errors found on |
25 // Refresh below. | 27 // Refresh below. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 filtered_policies.FilterLevel(level_); | 119 filtered_policies.FilterLevel(level_); |
118 | 120 |
119 scoped_ptr<PolicyErrorMap> errors(new PolicyErrorMap); | 121 scoped_ptr<PolicyErrorMap> errors(new PolicyErrorMap); |
120 | 122 |
121 handler_list_->ApplyPolicySettings(filtered_policies, | 123 handler_list_->ApplyPolicySettings(filtered_policies, |
122 prefs.get(), | 124 prefs.get(), |
123 errors.get()); | 125 errors.get()); |
124 | 126 |
125 // Retrieve and log the errors once the UI loop is ready. This is only an | 127 // Retrieve and log the errors once the UI loop is ready. This is only an |
126 // issue during startup. | 128 // issue during startup. |
127 base::MessageLoop::current()->PostTask( | 129 base::ThreadTaskRunnerHandle::Get()->PostTask( |
128 FROM_HERE, base::Bind(&LogErrors, base::Owned(errors.release()))); | 130 FROM_HERE, base::Bind(&LogErrors, base::Owned(errors.release()))); |
129 | 131 |
130 return prefs.release(); | 132 return prefs.release(); |
131 } | 133 } |
132 | 134 |
133 } // namespace policy | 135 } // namespace policy |
OLD | NEW |