| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 ChromeBrowserMainPartsLinux::PreProfileInit(); | 527 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 528 | 528 |
| 529 if (immediate_login) { | 529 if (immediate_login) { |
| 530 const std::string cryptohome_id = | 530 const std::string cryptohome_id = |
| 531 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); | 531 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); |
| 532 const AccountId account_id( | 532 const AccountId account_id( |
| 533 cryptohome::Identification::FromString(cryptohome_id).GetAccountId()); | 533 cryptohome::Identification::FromString(cryptohome_id).GetAccountId()); |
| 534 | 534 |
| 535 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 535 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 536 | 536 |
| 537 if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && | 537 if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), nullptr) && |
| 538 !user_manager->IsKnownUser(account_id)) { | 538 !user_manager->IsKnownUser(account_id)) { |
| 539 // When a device-local account is removed, its policy is deleted from disk | 539 // When a device-local account is removed, its policy is deleted from disk |
| 540 // immediately. If a session using this account happens to be in progress, | 540 // immediately. If a session using this account happens to be in progress, |
| 541 // the session is allowed to continue with policy served from an in-memory | 541 // the session is allowed to continue with policy served from an in-memory |
| 542 // cache. If Chrome crashes later in the session, the policy becomes | 542 // cache. If Chrome crashes later in the session, the policy becomes |
| 543 // completely unavailable. Exit the session in that case, rather than | 543 // completely unavailable. Exit the session in that case, rather than |
| 544 // allowing it to continue without policy. | 544 // allowing it to continue without policy. |
| 545 chrome::AttemptUserExit(); | 545 chrome::AttemptUserExit(); |
| 546 return; | 546 return; |
| 547 } | 547 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 658 |
| 659 // Initialize input methods. | 659 // Initialize input methods. |
| 660 input_method::InputMethodManager* manager = | 660 input_method::InputMethodManager* manager = |
| 661 input_method::InputMethodManager::Get(); | 661 input_method::InputMethodManager::Get(); |
| 662 UserSessionManager* session_manager = UserSessionManager::GetInstance(); | 662 UserSessionManager* session_manager = UserSessionManager::GetInstance(); |
| 663 DCHECK(manager); | 663 DCHECK(manager); |
| 664 DCHECK(session_manager); | 664 DCHECK(session_manager); |
| 665 | 665 |
| 666 manager->SetState(session_manager->GetDefaultIMEState(profile())); | 666 manager->SetState(session_manager->GetDefaultIMEState(profile())); |
| 667 | 667 |
| 668 bool is_running_test = parameters().ui_task != NULL; | 668 bool is_running_test = parameters().ui_task != nullptr; |
| 669 g_browser_process->platform_part()->InitializeSessionManager( | 669 g_browser_process->platform_part()->InitializeSessionManager( |
| 670 parsed_command_line(), profile(), is_running_test); | 670 parsed_command_line(), profile(), is_running_test); |
| 671 g_browser_process->platform_part()->SessionManager()->Start(); | 671 g_browser_process->platform_part()->SessionManager()->Start(); |
| 672 | 672 |
| 673 // Guest user profile is never initialized with locale settings, | 673 // Guest user profile is never initialized with locale settings, |
| 674 // so we need special handling for Guest session. | 674 // so we need special handling for Guest session. |
| 675 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 675 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
| 676 SetGuestLocale(profile()); | 676 SetGuestLocale(profile()); |
| 677 | 677 |
| 678 peripheral_battery_observer_.reset(new PeripheralBatteryObserver()); | 678 peripheral_battery_observer_.reset(new PeripheralBatteryObserver()); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // Destroy DBus services immediately after threads are stopped. | 878 // Destroy DBus services immediately after threads are stopped. |
| 879 dbus_services_.reset(); | 879 dbus_services_.reset(); |
| 880 | 880 |
| 881 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 881 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 882 | 882 |
| 883 // Destroy DeviceSettingsService after g_browser_process. | 883 // Destroy DeviceSettingsService after g_browser_process. |
| 884 DeviceSettingsService::Shutdown(); | 884 DeviceSettingsService::Shutdown(); |
| 885 } | 885 } |
| 886 | 886 |
| 887 } // namespace chromeos | 887 } // namespace chromeos |
| OLD | NEW |