| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 ShouldAutoLaunchKioskApp(parsed_command_line())) { | 461 ShouldAutoLaunchKioskApp(parsed_command_line())) { |
| 462 WizardController::SetZeroDelays(); | 462 WizardController::SetZeroDelays(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 power_prefs_.reset(new PowerPrefs(PowerPolicyController::Get())); | 465 power_prefs_.reset(new PowerPrefs(PowerPolicyController::Get())); |
| 466 | 466 |
| 467 // In Aura builds this will initialize ash::Shell. | 467 // In Aura builds this will initialize ash::Shell. |
| 468 ChromeBrowserMainPartsLinux::PreProfileInit(); | 468 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 469 | 469 |
| 470 if (immediate_login) { | 470 if (immediate_login) { |
| 471 const std::string user_id = login::CanonicalizeUserID( | 471 const std::string user_email = login::CanonicalizeUserID( |
| 472 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser)); | 472 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser)); |
| 473 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 473 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 474 | 474 |
| 475 if (policy::IsDeviceLocalAccountUser(user_id, NULL) && | 475 const AccountId account_id(AccountId::FromUserEmail(user_email)); |
| 476 !user_manager->IsKnownUser(user_id)) { | 476 if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && |
| 477 !user_manager->IsKnownUser(account_id)) { |
| 477 // When a device-local account is removed, its policy is deleted from disk | 478 // When a device-local account is removed, its policy is deleted from disk |
| 478 // immediately. If a session using this account happens to be in progress, | 479 // immediately. If a session using this account happens to be in progress, |
| 479 // the session is allowed to continue with policy served from an in-memory | 480 // the session is allowed to continue with policy served from an in-memory |
| 480 // cache. If Chrome crashes later in the session, the policy becomes | 481 // cache. If Chrome crashes later in the session, the policy becomes |
| 481 // completely unavailable. Exit the session in that case, rather than | 482 // completely unavailable. Exit the session in that case, rather than |
| 482 // allowing it to continue without policy. | 483 // allowing it to continue without policy. |
| 483 chrome::AttemptUserExit(); | 484 chrome::AttemptUserExit(); |
| 484 return; | 485 return; |
| 485 } | 486 } |
| 486 | 487 |
| 487 // In case of multi-profiles --login-profile will contain user_id_hash. | 488 // In case of multi-profiles --login-profile will contain user_id_hash. |
| 488 std::string user_id_hash = | 489 std::string user_id_hash = |
| 489 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); | 490 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); |
| 490 user_manager->UserLoggedIn(user_id, user_id_hash, true); | 491 user_manager->UserLoggedIn(account_id, user_id_hash, true); |
| 491 VLOG(1) << "Relaunching browser for user: " << user_id | 492 VLOG(1) << "Relaunching browser for user: " << user_email |
| 492 << " with hash: " << user_id_hash; | 493 << " with hash: " << user_id_hash; |
| 493 } | 494 } |
| 494 } | 495 } |
| 495 | 496 |
| 496 class GuestLanguageSetCallbackData { | 497 class GuestLanguageSetCallbackData { |
| 497 public: | 498 public: |
| 498 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { | 499 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { |
| 499 } | 500 } |
| 500 | 501 |
| 501 // Must match SwitchLanguageCallback type. | 502 // Must match SwitchLanguageCallback type. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 // Destroy DBus services immediately after threads are stopped. | 789 // Destroy DBus services immediately after threads are stopped. |
| 789 dbus_services_.reset(); | 790 dbus_services_.reset(); |
| 790 | 791 |
| 791 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 792 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 792 | 793 |
| 793 // Destroy DeviceSettingsService after g_browser_process. | 794 // Destroy DeviceSettingsService after g_browser_process. |
| 794 DeviceSettingsService::Shutdown(); | 795 DeviceSettingsService::Shutdown(); |
| 795 } | 796 } |
| 796 | 797 |
| 797 } // namespace chromeos | 798 } // namespace chromeos |
| OLD | NEW |