| 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/base_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // auto-enrollment check can start. This happens either after the EULA is | 255 // auto-enrollment check can start. This happens either after the EULA is |
| 256 // accepted, or right after a reboot if the EULA has already been accepted. | 256 // accepted, or right after a reboot if the EULA has already been accepted. |
| 257 | 257 |
| 258 if (policy::AutoEnrollmentClient::IsDisabled()) { | 258 if (policy::AutoEnrollmentClient::IsDisabled()) { |
| 259 VLOG(1) << "CheckForAutoEnrollment: auto-enrollment disabled"; | 259 VLOG(1) << "CheckForAutoEnrollment: auto-enrollment disabled"; |
| 260 return; | 260 return; |
| 261 } | 261 } |
| 262 | 262 |
| 263 // Start by checking if the device has already been owned. | 263 // Start by checking if the device has already been owned. |
| 264 pointer_factory_.InvalidateWeakPtrs(); | 264 pointer_factory_.InvalidateWeakPtrs(); |
| 265 OwnershipService::GetSharedInstance()->GetStatusAsync( | 265 DeviceSettingsService::Get()->GetOwnershipStatusAsync( |
| 266 base::Bind(&BaseLoginDisplayHost::OnOwnershipStatusCheckDone, | 266 base::Bind(&BaseLoginDisplayHost::OnOwnershipStatusCheckDone, |
| 267 pointer_factory_.GetWeakPtr())); | 267 pointer_factory_.GetWeakPtr())); |
| 268 } | 268 } |
| 269 | 269 |
| 270 //////////////////////////////////////////////////////////////////////////////// | 270 //////////////////////////////////////////////////////////////////////////////// |
| 271 // BaseLoginDisplayHost, content:NotificationObserver implementation: | 271 // BaseLoginDisplayHost, content:NotificationObserver implementation: |
| 272 | 272 |
| 273 void BaseLoginDisplayHost::Observe( | 273 void BaseLoginDisplayHost::Observe( |
| 274 int type, | 274 int type, |
| 275 const content::NotificationSource& source, | 275 const content::NotificationSource& source, |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 | 401 |
| 402 if (do_browser_transform_animation) { | 402 if (do_browser_transform_animation) { |
| 403 settings.SetTweenType(ui::Tween::EASE_OUT); | 403 settings.SetTweenType(ui::Tween::EASE_OUT); |
| 404 default_container_layer->SetTransform(ui::Transform()); | 404 default_container_layer->SetTransform(ui::Transform()); |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 void BaseLoginDisplayHost::OnOwnershipStatusCheckDone( | 409 void BaseLoginDisplayHost::OnOwnershipStatusCheckDone( |
| 410 OwnershipService::Status status, | 410 DeviceSettingsService::OwnershipStatus status, |
| 411 bool current_user_is_owner) { | 411 bool current_user_is_owner) { |
| 412 if (status != OwnershipService::OWNERSHIP_NONE) { | 412 if (status != DeviceSettingsService::OWNERSHIP_NONE) { |
| 413 // The device is already owned. No need for auto-enrollment checks. | 413 // The device is already owned. No need for auto-enrollment checks. |
| 414 VLOG(1) << "CheckForAutoEnrollment: device already owned"; | 414 VLOG(1) << "CheckForAutoEnrollment: device already owned"; |
| 415 return; | 415 return; |
| 416 } | 416 } |
| 417 | 417 |
| 418 // Kick off the auto-enrollment client. | 418 // Kick off the auto-enrollment client. |
| 419 if (auto_enrollment_client_.get()) { | 419 if (auto_enrollment_client_.get()) { |
| 420 // They client might have been started after the EULA screen, but we made | 420 // They client might have been started after the EULA screen, but we made |
| 421 // it to the login screen before it finished. In that case let the current | 421 // it to the login screen before it finished. In that case let the current |
| 422 // client proceed. | 422 // client proceed. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 VLOG(1) << "Initial time zone: " << timezone_name; | 567 VLOG(1) << "Initial time zone: " << timezone_name; |
| 568 // Apply locale customizations only once to preserve whatever locale | 568 // Apply locale customizations only once to preserve whatever locale |
| 569 // user has changed to during OOBE. | 569 // user has changed to during OOBE. |
| 570 if (!timezone_name.empty()) { | 570 if (!timezone_name.empty()) { |
| 571 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 571 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 572 UTF8ToUTF16(timezone_name)); | 572 UTF8ToUTF16(timezone_name)); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace chromeos | 576 } // namespace chromeos |
| OLD | NEW |