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 9023959c0ac2c155b807eec7e39bbe96cfd28f4a..2243e92b864fc30223561bf0d6f9f26b942a7d20 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,7 +11,6 @@ |
#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" |
@@ -26,7 +25,30 @@ |
// creates a user in whose context the app then runs. |
class ArcKioskAppManager { |
public: |
- using Apps = std::vector<ArcKioskAppData*>; |
+ // 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>; |
class ArcKioskAppManagerObserver { |
public: |
@@ -35,8 +57,6 @@ |
protected: |
virtual ~ArcKioskAppManagerObserver() = default; |
}; |
- |
- static const char kArcKioskDictionaryName[]; |
static ArcKioskAppManager* Get(); |
@@ -54,13 +74,9 @@ |
const AccountId& GetAutoLaunchAccountId() const; |
// Returns app that should be started for given account id. |
- const ArcKioskAppData* GetAppByAccountId(const AccountId& account_id); |
+ const ArcKioskApp* GetAppByAccountId(const AccountId& account_id); |
- void GetAllApps(Apps* apps) const; |
- |
- void UpdateNameAndIcon(const std::string& app_id, |
- const std::string& name, |
- const gfx::ImageSkia& icon); |
+ const ArcKioskApps& GetAllApps() const { return apps_; } |
void AddObserver(ArcKioskAppManagerObserver* observer); |
void RemoveObserver(ArcKioskAppManagerObserver* observer); |
@@ -75,10 +91,9 @@ |
// Removes cryptohomes of the removed apps. Terminates the session if |
// a removed app is running. |
- void ClearRemovedApps( |
- const std::map<std::string, std::unique_ptr<ArcKioskAppData>>& old_apps); |
+ void ClearRemovedApps(const ArcKioskApps& old_apps); |
- std::vector<std::unique_ptr<ArcKioskAppData>> apps_; |
+ ArcKioskApps apps_; |
AccountId auto_launch_account_id_; |
bool auto_launched_with_zero_delay_ = false; |
base::ObserverList<ArcKioskAppManagerObserver, true> observers_; |