| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Registers kiosk app entries in local state. | 66 // Registers kiosk app entries in local state. |
| 67 static void RegisterPrefs(PrefRegistrySimple* registry); | 67 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 68 | 68 |
| 69 // Removes cryptohomes which could not be removed during the previous session. | 69 // Removes cryptohomes which could not be removed during the previous session. |
| 70 static void RemoveObsoleteCryptohomes(); | 70 static void RemoveObsoleteCryptohomes(); |
| 71 | 71 |
| 72 // Returns auto launched account id. If there is none, account is invalid, | 72 // Returns auto launched account id. If there is none, account is invalid, |
| 73 // thus is_valid() returns empty AccountId. | 73 // thus is_valid() returns empty AccountId. |
| 74 const AccountId& GetAutoLaunchAccountId() const; | 74 const AccountId& GetAutoLaunchAccountId() const; |
| 75 | 75 |
| 76 // Returns app that should be started for given account id. |
| 77 const ArcKioskApp* GetAppByAccountId(const AccountId& account_id); |
| 78 |
| 76 const ArcKioskApps& GetAllApps() const { return apps_; } | 79 const ArcKioskApps& GetAllApps() const { return apps_; } |
| 77 | 80 |
| 78 void AddObserver(ArcKioskAppManagerObserver* observer); | 81 void AddObserver(ArcKioskAppManagerObserver* observer); |
| 79 void RemoveObserver(ArcKioskAppManagerObserver* observer); | 82 void RemoveObserver(ArcKioskAppManagerObserver* observer); |
| 80 | 83 |
| 81 private: | 84 private: |
| 82 // Updates apps_ based on CrosSettings. | 85 // Updates apps_ based on CrosSettings. |
| 83 void UpdateApps(); | 86 void UpdateApps(); |
| 84 | 87 |
| 85 // Removes cryptohomes of the removed apps. Terminates the session if | 88 // Removes cryptohomes of the removed apps. Terminates the session if |
| 86 // a removed app is running. | 89 // a removed app is running. |
| 87 void ClearRemovedApps(const ArcKioskApps& old_apps); | 90 void ClearRemovedApps(const ArcKioskApps& old_apps); |
| 88 | 91 |
| 89 ArcKioskApps apps_; | 92 ArcKioskApps apps_; |
| 90 AccountId auto_launch_account_id_; | 93 AccountId auto_launch_account_id_; |
| 91 base::ObserverList<ArcKioskAppManagerObserver, true> observers_; | 94 base::ObserverList<ArcKioskAppManagerObserver, true> observers_; |
| 92 | 95 |
| 93 std::unique_ptr<CrosSettings::ObserverSubscription> | 96 std::unique_ptr<CrosSettings::ObserverSubscription> |
| 94 local_accounts_subscription_; | 97 local_accounts_subscription_; |
| 95 std::unique_ptr<CrosSettings::ObserverSubscription> | 98 std::unique_ptr<CrosSettings::ObserverSubscription> |
| 96 local_account_auto_login_id_subscription_; | 99 local_account_auto_login_id_subscription_; |
| 97 | 100 |
| 98 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppManager); | 101 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppManager); |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 } // namespace chromeos | 104 } // namespace chromeos |
| 102 | 105 |
| 103 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_ |
| OLD | NEW |