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

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

Issue 2899983002: Enable Chromad for beta and stable channels (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos/policy/enrollment_handler_chromeos.h" 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/sequenced_task_runner.h" 14 #include "base/sequenced_task_runner.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/threading/thread_task_runner_handle.h" 16 #include "base/threading/thread_task_runner_handle.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" 18 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h"
19 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" 19 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
20 #include "chrome/browser/chromeos/policy/active_directory_join_delegate.h" 20 #include "chrome/browser/chromeos/policy/active_directory_join_delegate.h"
21 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" 21 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
22 #include "chrome/browser/chromeos/policy/dm_token_storage.h" 22 #include "chrome/browser/chromeos/policy/dm_token_storage.h"
23 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" 23 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
24 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 24 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
25 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h" 25 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h"
26 #include "chrome/browser/chromeos/profiles/profile_helper.h" 26 #include "chrome/browser/chromeos/profiles/profile_helper.h"
27 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" 27 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
28 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h " 28 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
29 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/common/channel_info.h"
31 #include "chromeos/attestation/attestation_flow.h" 30 #include "chromeos/attestation/attestation_flow.h"
32 #include "chromeos/chromeos_switches.h" 31 #include "chromeos/chromeos_switches.h"
33 #include "chromeos/dbus/auth_policy_client.h" 32 #include "chromeos/dbus/auth_policy_client.h"
34 #include "chromeos/dbus/cryptohome/rpc.pb.h" 33 #include "chromeos/dbus/cryptohome/rpc.pb.h"
35 #include "chromeos/dbus/dbus_thread_manager.h" 34 #include "chromeos/dbus/dbus_thread_manager.h"
36 #include "chromeos/dbus/upstart_client.h" 35 #include "chromeos/dbus/upstart_client.h"
37 #include "components/version_info/version_info.h"
38 #include "google_apis/gaia/gaia_auth_util.h" 36 #include "google_apis/gaia/gaia_auth_util.h"
39 #include "google_apis/gaia/gaia_urls.h" 37 #include "google_apis/gaia/gaia_urls.h"
40 #include "net/http/http_status_code.h" 38 #include "net/http/http_status_code.h"
41 39
42 namespace em = enterprise_management; 40 namespace em = enterprise_management;
43 41
44 namespace policy { 42 namespace policy {
45 43
46 namespace { 44 namespace {
47 45
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 CloudPolicyClient* client) { 229 CloudPolicyClient* client) {
232 DCHECK_EQ(client_.get(), client); 230 DCHECK_EQ(client_.get(), client);
233 231
234 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { 232 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) {
235 device_mode_ = client_->device_mode(); 233 device_mode_ = client_->device_mode();
236 switch (device_mode_) { 234 switch (device_mode_) {
237 case DEVICE_MODE_ENTERPRISE: 235 case DEVICE_MODE_ENTERPRISE:
238 // Do nothing. 236 // Do nothing.
239 break; 237 break;
240 case DEVICE_MODE_ENTERPRISE_AD: 238 case DEVICE_MODE_ENTERPRISE_AD:
241 if (chrome::GetChannel() == version_info::Channel::BETA ||
242 chrome::GetChannel() == version_info::Channel::STABLE) {
243 LOG(ERROR) << "Active Directory management is not enabled on the "
244 "current channel";
245 ReportResult(EnrollmentStatus::ForStatus(
246 EnrollmentStatus::REGISTRATION_BAD_MODE));
247 return;
248 }
249 chromeos::DBusThreadManager::Get() 239 chromeos::DBusThreadManager::Get()
250 ->GetUpstartClient() 240 ->GetUpstartClient()
251 ->StartAuthPolicyService(); 241 ->StartAuthPolicyService();
252 break; 242 break;
253 default: 243 default:
254 LOG(ERROR) << "Supplied device mode is not supported:" << device_mode_; 244 LOG(ERROR) << "Supplied device mode is not supported:" << device_mode_;
255 ReportResult(EnrollmentStatus::ForStatus( 245 ReportResult(EnrollmentStatus::ForStatus(
256 EnrollmentStatus::REGISTRATION_BAD_MODE)); 246 EnrollmentStatus::REGISTRATION_BAD_MODE));
257 return; 247 return;
258 } 248 }
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 callback.Run(status); 652 callback.Run(status);
663 } 653 }
664 654
665 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { 655 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) {
666 DCHECK_LE(enrollment_step_, step); 656 DCHECK_LE(enrollment_step_, step);
667 VLOG(1) << "Step: " << step; 657 VLOG(1) << "Step: " << step;
668 enrollment_step_ = step; 658 enrollment_step_ = step;
669 } 659 }
670 660
671 } // namespace policy 661 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698