| 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 "chrome/browser/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Cleanup properly in those cases and avoid crashing the ToastCrasher test. | 145 // Cleanup properly in those cases and avoid crashing the ToastCrasher test. |
| 146 Shutdown(); | 146 Shutdown(); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 void BrowserPolicyConnector::Init( | 150 void BrowserPolicyConnector::Init( |
| 151 PrefService* local_state, | 151 PrefService* local_state, |
| 152 scoped_refptr<net::URLRequestContextGetter> request_context) { | 152 scoped_refptr<net::URLRequestContextGetter> request_context) { |
| 153 // Initialization of some of the providers requires the FILE thread; make | 153 // Initialization of some of the providers requires the FILE thread; make |
| 154 // sure that threading is ready at this point. | 154 // sure that threading is ready at this point. |
| 155 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::FILE)); | 155 DCHECK(BrowserThread::IsThreadInitialized(BrowserThread::FILE)); |
| 156 DCHECK(!is_initialized()) << "BrowserPolicyConnector::Init() called twice."; | 156 DCHECK(!is_initialized()) << "BrowserPolicyConnector::Init() called twice."; |
| 157 | 157 |
| 158 local_state_ = local_state; | 158 local_state_ = local_state; |
| 159 request_context_ = request_context; | 159 request_context_ = request_context; |
| 160 | 160 |
| 161 device_management_service_->ScheduleInitialization( | 161 device_management_service_->ScheduleInitialization( |
| 162 kServiceInitializationStartupDelay); | 162 kServiceInitializationStartupDelay); |
| 163 | 163 |
| 164 if (g_testing_provider) | 164 if (g_testing_provider) |
| 165 g_testing_provider->Init(); | 165 g_testing_provider->Init(); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 return new AsyncPolicyProvider(loader.Pass()); | 475 return new AsyncPolicyProvider(loader.Pass()); |
| 476 } else { | 476 } else { |
| 477 return NULL; | 477 return NULL; |
| 478 } | 478 } |
| 479 #else | 479 #else |
| 480 return NULL; | 480 return NULL; |
| 481 #endif | 481 #endif |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace policy | 484 } // namespace policy |
| OLD | NEW |