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. |
584 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) { | 587 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) { |
585 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 588 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
586 switches::kLoginUser)) { | 589 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 auto_launched = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
592 switches::kAppAutoLaunched); | |
593 extensions::SetCurrentFeatureSessionType( | 590 extensions::SetCurrentFeatureSessionType( |
594 auto_launched ? extensions::FeatureSessionType::AUTOLAUNCHED_KIOSK | 591 extensions::FeatureSessionType::KIOSK); |
595 : extensions::FeatureSessionType::KIOSK); | |
596 } | 592 } |
597 return; | 593 return; |
598 } | 594 } |
599 | 595 |
600 extensions::SetCurrentFeatureSessionType( | 596 extensions::SetCurrentFeatureSessionType( |
601 user->HasGaiaAccount() ? extensions::FeatureSessionType::REGULAR | 597 user->HasGaiaAccount() ? extensions::FeatureSessionType::REGULAR |
602 : extensions::FeatureSessionType::UNKNOWN); | 598 : extensions::FeatureSessionType::UNKNOWN); |
603 } | 599 } |
604 | 600 |
605 void UserSessionManager::SetFirstLoginPrefs( | 601 void UserSessionManager::SetFirstLoginPrefs( |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 ->browser_policy_connector_chromeos() | 1887 ->browser_policy_connector_chromeos() |
1892 ->IsEnterpriseManaged()) { | 1888 ->IsEnterpriseManaged()) { |
1893 return false; | 1889 return false; |
1894 } | 1890 } |
1895 | 1891 |
1896 // Do not show end of life notification if this is a guest session | 1892 // Do not show end of life notification if this is a guest session |
1897 return !profile->IsGuestSession(); | 1893 return !profile->IsGuestSession(); |
1898 } | 1894 } |
1899 | 1895 |
1900 } // namespace chromeos | 1896 } // namespace chromeos |
OLD | NEW |