| 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/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/browser/chromeos/login/login_wizard.h" | 30 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 31 #include "chrome/browser/chromeos/login/user_manager.h" | 31 #include "chrome/browser/chromeos/login/user_manager.h" |
| 32 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 32 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
| 33 #include "chrome/browser/chromeos/login/wizard_controller.h" | 33 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 34 #include "chrome/browser/chromeos/mobile_config.h" | 34 #include "chrome/browser/chromeos/mobile_config.h" |
| 35 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" | 35 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
| 36 #include "chrome/browser/chromeos/system/input_device_settings.h" | 36 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 37 #include "chrome/browser/chromeos/system/timezone_settings.h" | 37 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 38 #include "chrome/browser/managed_mode/managed_mode.h" | 38 #include "chrome/browser/managed_mode/managed_mode.h" |
| 39 #include "chrome/browser/policy/browser_policy_connector.h" | 39 #include "chrome/browser/policy/browser_policy_connector.h" |
| 40 #include "chrome/browser/profiles/profile_destroyer.h" |
| 40 #include "chrome/common/chrome_notification_types.h" | 41 #include "chrome/common/chrome_notification_types.h" |
| 41 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "chromeos/dbus/dbus_thread_manager.h" | 44 #include "chromeos/dbus/dbus_thread_manager.h" |
| 44 #include "chromeos/dbus/session_manager_client.h" | 45 #include "chromeos/dbus/session_manager_client.h" |
| 45 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/notification_types.h" | 47 #include "content/public/browser/notification_types.h" |
| 47 #include "googleurl/src/gurl.h" | 48 #include "googleurl/src/gurl.h" |
| 48 #include "ui/aura/window.h" | 49 #include "ui/aura/window.h" |
| 49 #include "ui/base/events/event_utils.h" | 50 #include "ui/base/events/event_utils.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 161 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 162 //////////////////////////////////////////////////////////////////////////////// |
| 162 // BaseLoginDisplayHost, LoginDisplayHost implementation: | 163 // BaseLoginDisplayHost, LoginDisplayHost implementation: |
| 163 | 164 |
| 164 void BaseLoginDisplayHost::BeforeSessionStart() { | 165 void BaseLoginDisplayHost::BeforeSessionStart() { |
| 165 session_starting_ = true; | 166 session_starting_ = true; |
| 166 } | 167 } |
| 167 | 168 |
| 168 void BaseLoginDisplayHost::OnSessionStart() { | 169 void BaseLoginDisplayHost::OnSessionStart() { |
| 169 DVLOG(1) << "Session starting"; | 170 DVLOG(1) << "Session starting"; |
| 170 if (chromeos::UserManager::Get()->IsCurrentUserNew()) { | 171 ash::Shell::GetInstance()-> |
| 171 ash::Shell::GetInstance()-> | 172 desktop_background_controller()->MoveDesktopToUnlockedContainer(); |
| 172 desktop_background_controller()->MoveDesktopToUnlockedContainer(); | |
| 173 } | |
| 174 if (wizard_controller_.get()) | 173 if (wizard_controller_.get()) |
| 175 wizard_controller_->OnSessionStart(); | 174 wizard_controller_->OnSessionStart(); |
| 175 ProfileDestroyer::DestroyProfileWhenAppropriate( |
| 176 ProfileManager::GetSigninProfile()); |
| 176 // Display host is deleted once animation is completed | 177 // Display host is deleted once animation is completed |
| 177 // since sign in screen widget has to stay alive. | 178 // since sign in screen widget has to stay alive. |
| 178 StartAnimation(); | 179 StartAnimation(); |
| 179 ShutdownDisplayHost(false); | 180 ShutdownDisplayHost(false); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void BaseLoginDisplayHost::OnCompleteLogin() { | 183 void BaseLoginDisplayHost::OnCompleteLogin() { |
| 183 // Cancelling the |auto_enrollment_client_| now allows it to determine whether | 184 // Cancelling the |auto_enrollment_client_| now allows it to determine whether |
| 184 // its protocol finished before login was complete. | 185 // its protocol finished before login was complete. |
| 185 if (auto_enrollment_client_.get()) | 186 if (auto_enrollment_client_.get()) |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 VLOG(1) << "Initial time zone: " << timezone_name; | 509 VLOG(1) << "Initial time zone: " << timezone_name; |
| 509 // Apply locale customizations only once to preserve whatever locale | 510 // Apply locale customizations only once to preserve whatever locale |
| 510 // user has changed to during OOBE. | 511 // user has changed to during OOBE. |
| 511 if (!timezone_name.empty()) { | 512 if (!timezone_name.empty()) { |
| 512 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 513 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 513 UTF8ToUTF16(timezone_name)); | 514 UTF8ToUTF16(timezone_name)); |
| 514 } | 515 } |
| 515 } | 516 } |
| 516 | 517 |
| 517 } // namespace chromeos | 518 } // namespace chromeos |
| OLD | NEW |