Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc

Issue 493613002: Add an enrolling state for consumer management section in settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dn
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 consumer_device_management_service_.reset( 149 consumer_device_management_service_.reset(
150 new DeviceManagementService(configuration.Pass())); 150 new DeviceManagementService(configuration.Pass()));
151 consumer_device_management_service_->ScheduleInitialization( 151 consumer_device_management_service_->ScheduleInitialization(
152 kServiceInitializationStartupDelay); 152 kServiceInitializationStartupDelay);
153 153
154 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 154 const CommandLine* command_line = CommandLine::ForCurrentProcess();
155 if (command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement)) { 155 if (command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement)) {
156 chromeos::CryptohomeClient* cryptohome_client = 156 chromeos::CryptohomeClient* cryptohome_client =
157 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); 157 chromeos::DBusThreadManager::Get()->GetCryptohomeClient();
158 consumer_management_service_.reset( 158 consumer_management_service_.reset(
159 new ConsumerManagementService(cryptohome_client)); 159 new ConsumerManagementService(cryptohome_client,
160 chromeos::DeviceSettingsService::Get()));
160 } 161 }
161 162
162 if (device_cloud_policy_manager_) { 163 if (device_cloud_policy_manager_) {
163 // Note: for now the |device_cloud_policy_manager_| is using the global 164 // Note: for now the |device_cloud_policy_manager_| is using the global
164 // schema registry. Eventually it will have its own registry, once device 165 // schema registry. Eventually it will have its own registry, once device
165 // cloud policy for extensions is introduced. That means it'd have to be 166 // cloud policy for extensions is introduced. That means it'd have to be
166 // initialized from here instead of BrowserPolicyConnector::Init(). 167 // initialized from here instead of BrowserPolicyConnector::Init().
167 168
168 device_cloud_policy_manager_->Initialize(local_state); 169 device_cloud_policy_manager_->Initialize(local_state);
169 170
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // This function is invoked by DCPInitializer, so we should release the 337 // This function is invoked by DCPInitializer, so we should release the
337 // initializer after this function returns. 338 // initializer after this function returns.
338 if (device_cloud_policy_initializer_) { 339 if (device_cloud_policy_initializer_) {
339 device_cloud_policy_initializer_->Shutdown(); 340 device_cloud_policy_initializer_->Shutdown();
340 base::MessageLoop::current()->DeleteSoon( 341 base::MessageLoop::current()->DeleteSoon(
341 FROM_HERE, device_cloud_policy_initializer_.release()); 342 FROM_HERE, device_cloud_policy_initializer_.release());
342 } 343 }
343 } 344 }
344 345
345 } // namespace policy 346 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698