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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 ShouldAutoLaunchKioskApp(parsed_command_line())) { | 462 ShouldAutoLaunchKioskApp(parsed_command_line())) { |
463 WizardController::SetZeroDelays(); | 463 WizardController::SetZeroDelays(); |
464 } | 464 } |
465 | 465 |
466 power_prefs_.reset(new PowerPrefs(PowerPolicyController::Get())); | 466 power_prefs_.reset(new PowerPrefs(PowerPolicyController::Get())); |
467 | 467 |
468 // In Aura builds this will initialize ash::Shell. | 468 // In Aura builds this will initialize ash::Shell. |
469 ChromeBrowserMainPartsLinux::PreProfileInit(); | 469 ChromeBrowserMainPartsLinux::PreProfileInit(); |
470 | 470 |
471 if (immediate_login) { | 471 if (immediate_login) { |
472 const std::string user_email = login::CanonicalizeUserID( | 472 const std::string user_id = login::CanonicalizeUserID( |
473 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser)); | 473 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser)); |
474 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 474 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
475 | 475 |
476 const AccountId account_id(AccountId::FromUserEmail(user_email)); | 476 if (policy::IsDeviceLocalAccountUser(user_id, NULL) && |
477 if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && | 477 !user_manager->IsKnownUser(user_id)) { |
478 !user_manager->IsKnownUser(account_id)) { | |
479 // 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 |
480 // 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, |
481 // 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 |
482 // cache. If Chrome crashes later in the session, the policy becomes | 481 // cache. If Chrome crashes later in the session, the policy becomes |
483 // completely unavailable. Exit the session in that case, rather than | 482 // completely unavailable. Exit the session in that case, rather than |
484 // allowing it to continue without policy. | 483 // allowing it to continue without policy. |
485 chrome::AttemptUserExit(); | 484 chrome::AttemptUserExit(); |
486 return; | 485 return; |
487 } | 486 } |
488 | 487 |
489 // 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. |
490 std::string user_id_hash = | 489 std::string user_id_hash = |
491 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); | 490 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); |
492 user_manager->UserLoggedIn(account_id, user_id_hash, true); | 491 user_manager->UserLoggedIn(user_id, user_id_hash, true); |
493 VLOG(1) << "Relaunching browser for user: " << user_email | 492 VLOG(1) << "Relaunching browser for user: " << user_id |
494 << " with hash: " << user_id_hash; | 493 << " with hash: " << user_id_hash; |
495 } | 494 } |
496 } | 495 } |
497 | 496 |
498 class GuestLanguageSetCallbackData { | 497 class GuestLanguageSetCallbackData { |
499 public: | 498 public: |
500 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { | 499 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { |
501 } | 500 } |
502 | 501 |
503 // Must match SwitchLanguageCallback type. | 502 // Must match SwitchLanguageCallback type. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 // Destroy DBus services immediately after threads are stopped. | 796 // Destroy DBus services immediately after threads are stopped. |
798 dbus_services_.reset(); | 797 dbus_services_.reset(); |
799 | 798 |
800 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 799 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
801 | 800 |
802 // Destroy DeviceSettingsService after g_browser_process. | 801 // Destroy DeviceSettingsService after g_browser_process. |
803 DeviceSettingsService::Shutdown(); | 802 DeviceSettingsService::Shutdown(); |
804 } | 803 } |
805 | 804 |
806 } // namespace chromeos | 805 } // namespace chromeos |
OLD | NEW |