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_id = login::CanonicalizeUserID( | 472 const std::string user_email = 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 if (policy::IsDeviceLocalAccountUser(user_id, NULL) && | 476 const AccountId account_id(AccountId::FromUserEmail(user_email)); |
477 !user_manager->IsKnownUser(user_id)) { | 477 if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && |
| 478 !user_manager->IsKnownUser(account_id)) { |
478 // When a device-local account is removed, its policy is deleted from disk | 479 // When a device-local account is removed, its policy is deleted from disk |
479 // immediately. If a session using this account happens to be in progress, | 480 // immediately. If a session using this account happens to be in progress, |
480 // the session is allowed to continue with policy served from an in-memory | 481 // the session is allowed to continue with policy served from an in-memory |
481 // cache. If Chrome crashes later in the session, the policy becomes | 482 // cache. If Chrome crashes later in the session, the policy becomes |
482 // completely unavailable. Exit the session in that case, rather than | 483 // completely unavailable. Exit the session in that case, rather than |
483 // allowing it to continue without policy. | 484 // allowing it to continue without policy. |
484 chrome::AttemptUserExit(); | 485 chrome::AttemptUserExit(); |
485 return; | 486 return; |
486 } | 487 } |
487 | 488 |
488 // In case of multi-profiles --login-profile will contain user_id_hash. | 489 // In case of multi-profiles --login-profile will contain user_id_hash. |
489 std::string user_id_hash = | 490 std::string user_id_hash = |
490 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); | 491 parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); |
491 user_manager->UserLoggedIn(user_id, user_id_hash, true); | 492 user_manager->UserLoggedIn(account_id, user_id_hash, true); |
492 VLOG(1) << "Relaunching browser for user: " << user_id | 493 VLOG(1) << "Relaunching browser for user: " << user_email |
493 << " with hash: " << user_id_hash; | 494 << " with hash: " << user_id_hash; |
494 } | 495 } |
495 } | 496 } |
496 | 497 |
497 class GuestLanguageSetCallbackData { | 498 class GuestLanguageSetCallbackData { |
498 public: | 499 public: |
499 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { | 500 explicit GuestLanguageSetCallbackData(Profile* profile) : profile(profile) { |
500 } | 501 } |
501 | 502 |
502 // Must match SwitchLanguageCallback type. | 503 // Must match SwitchLanguageCallback type. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // Destroy DBus services immediately after threads are stopped. | 797 // Destroy DBus services immediately after threads are stopped. |
797 dbus_services_.reset(); | 798 dbus_services_.reset(); |
798 | 799 |
799 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 800 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
800 | 801 |
801 // Destroy DeviceSettingsService after g_browser_process. | 802 // Destroy DeviceSettingsService after g_browser_process. |
802 DeviceSettingsService::Shutdown(); | 803 DeviceSettingsService::Shutdown(); |
803 } | 804 } |
804 | 805 |
805 } // namespace chromeos | 806 } // namespace chromeos |
OLD | NEW |