| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/policy/browser_policy_connector_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 consumer_device_management_service_.reset( | 148 consumer_device_management_service_.reset( |
| 149 new DeviceManagementService(configuration.Pass())); | 149 new DeviceManagementService(configuration.Pass())); |
| 150 consumer_device_management_service_->ScheduleInitialization( | 150 consumer_device_management_service_->ScheduleInitialization( |
| 151 kServiceInitializationStartupDelay); | 151 kServiceInitializationStartupDelay); |
| 152 | 152 |
| 153 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 153 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 154 if (command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement)) { | 154 if (command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement)) { |
| 155 chromeos::CryptohomeClient* cryptohome_client = | 155 chromeos::CryptohomeClient* cryptohome_client = |
| 156 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); | 156 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); |
| 157 consumer_management_service_.reset( | 157 consumer_management_service_.reset( |
| 158 new ConsumerManagementService(cryptohome_client)); | 158 new ConsumerManagementService(cryptohome_client, |
| 159 chromeos::DeviceSettingsService::Get())); |
| 159 } | 160 } |
| 160 | 161 |
| 161 if (device_cloud_policy_manager_) { | 162 if (device_cloud_policy_manager_) { |
| 162 // Note: for now the |device_cloud_policy_manager_| is using the global | 163 // Note: for now the |device_cloud_policy_manager_| is using the global |
| 163 // schema registry. Eventually it will have its own registry, once device | 164 // schema registry. Eventually it will have its own registry, once device |
| 164 // cloud policy for extensions is introduced. That means it'd have to be | 165 // cloud policy for extensions is introduced. That means it'd have to be |
| 165 // initialized from here instead of BrowserPolicyConnector::Init(). | 166 // initialized from here instead of BrowserPolicyConnector::Init(). |
| 166 | 167 |
| 167 device_cloud_policy_manager_->Initialize(local_state); | 168 device_cloud_policy_manager_->Initialize(local_state); |
| 168 | 169 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // This function is invoked by DCPInitializer, so we should release the | 338 // This function is invoked by DCPInitializer, so we should release the |
| 338 // initializer after this function returns. | 339 // initializer after this function returns. |
| 339 if (device_cloud_policy_initializer_) { | 340 if (device_cloud_policy_initializer_) { |
| 340 device_cloud_policy_initializer_->Shutdown(); | 341 device_cloud_policy_initializer_->Shutdown(); |
| 341 base::MessageLoop::current()->DeleteSoon( | 342 base::MessageLoop::current()->DeleteSoon( |
| 342 FROM_HERE, device_cloud_policy_initializer_.release()); | 343 FROM_HERE, device_cloud_policy_initializer_.release()); |
| 343 } | 344 } |
| 344 } | 345 } |
| 345 | 346 |
| 346 } // namespace policy | 347 } // namespace policy |
| OLD | NEW |