| Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h
|
| diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h
|
| index 2243e92b864fc30223561bf0d6f9f26b942a7d20..3b5e64f289af52960af7a2d87d3a6faa6f4c33e2 100644
|
| --- a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h
|
| +++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/observer_list.h"
|
| +#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h"
|
| #include "chrome/browser/chromeos/policy/device_local_account.h"
|
| #include "chrome/browser/chromeos/settings/cros_settings.h"
|
| #include "components/signin/core/account_id/account_id.h"
|
| @@ -25,30 +26,7 @@ namespace chromeos {
|
| // creates a user in whose context the app then runs.
|
| class ArcKioskAppManager {
|
| public:
|
| - // Struct to hold full info about ARC Kiosk app. In future
|
| - // this structure may contain many extra fields, e.g. icon.
|
| - class ArcKioskApp {
|
| - public:
|
| - ArcKioskApp(const policy::ArcKioskAppBasicInfo& app_info,
|
| - const AccountId& account_id,
|
| - const std::string& name);
|
| - ArcKioskApp(const ArcKioskApp& other);
|
| - ~ArcKioskApp();
|
| -
|
| - bool operator==(const std::string& app_id) const;
|
| - bool operator==(const policy::ArcKioskAppBasicInfo& app_info) const;
|
| -
|
| - const policy::ArcKioskAppBasicInfo& app_info() const { return app_info_; }
|
| - const AccountId& account_id() const { return account_id_; }
|
| - const std::string& name() const { return name_; }
|
| -
|
| - private:
|
| - policy::ArcKioskAppBasicInfo app_info_;
|
| - AccountId account_id_;
|
| - std::string name_;
|
| - };
|
| -
|
| - using ArcKioskApps = std::vector<ArcKioskApp>;
|
| + using Apps = std::vector<ArcKioskAppData*>;
|
|
|
| class ArcKioskAppManagerObserver {
|
| public:
|
| @@ -58,6 +36,9 @@ class ArcKioskAppManager {
|
| virtual ~ArcKioskAppManagerObserver() = default;
|
| };
|
|
|
| + static const char kArcKioskDictionaryName[];
|
| + static const char kKeyApps[];
|
| +
|
| static ArcKioskAppManager* Get();
|
|
|
| ArcKioskAppManager();
|
| @@ -74,9 +55,13 @@ class ArcKioskAppManager {
|
| const AccountId& GetAutoLaunchAccountId() const;
|
|
|
| // Returns app that should be started for given account id.
|
| - const ArcKioskApp* GetAppByAccountId(const AccountId& account_id);
|
| + const ArcKioskAppData* GetAppByAccountId(const AccountId& account_id);
|
| +
|
| + void GetAllApps(Apps* apps) const;
|
|
|
| - const ArcKioskApps& GetAllApps() const { return apps_; }
|
| + void UpdateNameAndIcon(const std::string& app_id,
|
| + const std::string& name,
|
| + const gfx::ImageSkia& icon);
|
|
|
| void AddObserver(ArcKioskAppManagerObserver* observer);
|
| void RemoveObserver(ArcKioskAppManagerObserver* observer);
|
| @@ -91,9 +76,10 @@ class ArcKioskAppManager {
|
|
|
| // Removes cryptohomes of the removed apps. Terminates the session if
|
| // a removed app is running.
|
| - void ClearRemovedApps(const ArcKioskApps& old_apps);
|
| + void ClearRemovedApps(
|
| + const std::map<std::string, std::unique_ptr<ArcKioskAppData>>& old_apps);
|
|
|
| - ArcKioskApps apps_;
|
| + std::vector<std::unique_ptr<ArcKioskAppData>> apps_;
|
| AccountId auto_launch_account_id_;
|
| bool auto_launched_with_zero_delay_ = false;
|
| base::ObserverList<ArcKioskAppManagerObserver, true> observers_;
|
|
|