OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
574 } | 574 } |
575 | 575 |
576 void UserSessionManager::InitNonKioskExtensionFeaturesSessionType( | 576 void UserSessionManager::InitNonKioskExtensionFeaturesSessionType( |
577 const user_manager::User* user) { | 577 const user_manager::User* user) { |
578 // Kiosk session should be set as part of kiosk user session initialization | 578 // Kiosk session should be set as part of kiosk user session initialization |
579 // in normal circumstances (to be able to properly determine whether kiosk | 579 // in normal circumstances (to be able to properly determine whether kiosk |
580 // was auto-launched); in case of user session restore, feature session | 580 // was auto-launched); in case of user session restore, feature session |
581 // type has be set before kiosk app controller takes over, as at that point | 581 // type has be set before kiosk app controller takes over, as at that point |
582 // kiosk app profile would already be initialized - feature session type | 582 // kiosk app profile would already be initialized - feature session type |
583 // should be set before that. | 583 // should be set before that. |
584 // TODO(tbarzic): Note that this does not work well for auto-launched | |
585 // sessions, as information about whether session was auto-launched is not | |
586 // persisted over session restart - http://crbug.com/677340. | |
587 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) { | 584 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) { |
588 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 585 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
589 switches::kLoginUser)) { | 586 switches::kLoginUser)) { |
587 // For kiosk session crash recovery, feature session type has be set | |
588 // before kiosk app controller takes over, as at that point iosk app | |
589 // profile would already be initialized - feature session type | |
590 // should be set before that. | |
591 bool autolaunched = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
xiyuan
2017/01/25 21:06:43
nit: autolaunched -> auto_launched
tbarzic
2017/01/25 21:33:43
Done.
| |
592 switches::kAppAutoLaunched); | |
590 extensions::SetCurrentFeatureSessionType( | 593 extensions::SetCurrentFeatureSessionType( |
591 extensions::FeatureSessionType::KIOSK); | 594 autolaunched ? extensions::FeatureSessionType::AUTOLAUNCHED_KIOSK |
595 : extensions::FeatureSessionType::KIOSK); | |
592 } | 596 } |
593 return; | 597 return; |
594 } | 598 } |
595 | 599 |
596 extensions::SetCurrentFeatureSessionType( | 600 extensions::SetCurrentFeatureSessionType( |
597 user->HasGaiaAccount() ? extensions::FeatureSessionType::REGULAR | 601 user->HasGaiaAccount() ? extensions::FeatureSessionType::REGULAR |
598 : extensions::FeatureSessionType::UNKNOWN); | 602 : extensions::FeatureSessionType::UNKNOWN); |
599 } | 603 } |
600 | 604 |
601 void UserSessionManager::SetFirstLoginPrefs( | 605 void UserSessionManager::SetFirstLoginPrefs( |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1887 ->browser_policy_connector_chromeos() | 1891 ->browser_policy_connector_chromeos() |
1888 ->IsEnterpriseManaged()) { | 1892 ->IsEnterpriseManaged()) { |
1889 return false; | 1893 return false; |
1890 } | 1894 } |
1891 | 1895 |
1892 // Do not show end of life notification if this is a guest session | 1896 // Do not show end of life notification if this is a guest session |
1893 return !profile->IsGuestSession(); | 1897 return !profile->IsGuestSession(); |
1894 } | 1898 } |
1895 | 1899 |
1896 } // namespace chromeos | 1900 } // namespace chromeos |
OLD | NEW |