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/chromeos/login/enrollment/enterprise_enrollment_screen. h" | 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/chromeos/cros/cros_library.h" | 12 #include "chrome/browser/chromeos/cros/cros_library.h" |
13 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 13 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
14 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | |
15 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | |
14 #include "chrome/browser/chromeos/login/authenticator.h" | 16 #include "chrome/browser/chromeos/login/authenticator.h" |
15 #include "chrome/browser/chromeos/login/screen_observer.h" | 17 #include "chrome/browser/chromeos/login/screen_observer.h" |
16 #include "chrome/browser/policy/auto_enrollment_client.h" | 18 #include "chrome/browser/policy/auto_enrollment_client.h" |
17 #include "chrome/browser/policy/browser_policy_connector.h" | 19 #include "chrome/browser/policy/browser_policy_connector.h" |
18 #include "chrome/browser/policy/cloud_policy_data_store.h" | 20 #include "chrome/browser/policy/cloud_policy_data_store.h" |
19 #include "chrome/browser/policy/enterprise_metrics.h" | 21 #include "chrome/browser/policy/enterprise_metrics.h" |
20 | 22 |
21 namespace chromeos { | 23 namespace chromeos { |
22 | 24 |
23 namespace { | 25 namespace { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 } | 73 } |
72 | 74 |
73 void EnterpriseEnrollmentScreen::OnOAuthTokenAvailable( | 75 void EnterpriseEnrollmentScreen::OnOAuthTokenAvailable( |
74 const std::string& user, | 76 const std::string& user, |
75 const std::string& token) { | 77 const std::string& token) { |
76 user_ = Authenticator::Canonicalize(user); | 78 user_ = Authenticator::Canonicalize(user); |
77 RegisterForDevicePolicy(token); | 79 RegisterForDevicePolicy(token); |
78 } | 80 } |
79 | 81 |
80 void EnterpriseEnrollmentScreen::OnConfirmationClosed(bool go_back_to_signin) { | 82 void EnterpriseEnrollmentScreen::OnConfirmationClosed(bool go_back_to_signin) { |
83 // If the machine has been put in KIOSK mode we have to restart the session | |
84 // here to go in the proper KIOSK mode login screen. | |
85 if (g_browser_process->browser_policy_connector()-> | |
86 GetDeviceCloudPolicyDataStore()->device_mode() == | |
Joao da Silva
2012/03/28 11:36:37
How about just browser_policy_connector()->GetDevi
pastarmovj
2012/03/28 11:43:15
They must have the right value if registration has
| |
87 policy::DEVICE_MODE_KIOSK) { | |
88 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); | |
89 return; | |
90 } | |
91 | |
81 get_screen_observer()->OnExit(go_back_to_signin ? | 92 get_screen_observer()->OnExit(go_back_to_signin ? |
82 ScreenObserver::ENTERPRISE_ENROLLMENT_COMPLETED : | 93 ScreenObserver::ENTERPRISE_ENROLLMENT_COMPLETED : |
83 ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); | 94 ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); |
84 } | 95 } |
85 | 96 |
86 bool EnterpriseEnrollmentScreen::IsAutoEnrollment(std::string* user) { | 97 bool EnterpriseEnrollmentScreen::IsAutoEnrollment(std::string* user) { |
87 if (is_auto_enrollment_) | 98 if (is_auto_enrollment_) |
88 *user = user_; | 99 *user = user_; |
89 return is_auto_enrollment_; | 100 return is_auto_enrollment_; |
90 } | 101 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 // and notify us of progress through CloudPolicySubsystem::Observer. | 226 // and notify us of progress through CloudPolicySubsystem::Observer. |
216 connector->RegisterForDevicePolicy(user_, token, is_auto_enrollment_); | 227 connector->RegisterForDevicePolicy(user_, token, is_auto_enrollment_); |
217 return; | 228 return; |
218 } | 229 } |
219 NOTREACHED(); | 230 NOTREACHED(); |
220 if (is_showing_) | 231 if (is_showing_) |
221 actor_->ShowFatalEnrollmentError(); | 232 actor_->ShowFatalEnrollmentError(); |
222 } | 233 } |
223 | 234 |
224 } // namespace chromeos | 235 } // namespace chromeos |
OLD | NEW |