| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/files/file_path.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_data_base.h" | |
| 13 #include "components/signin/core/account_id/account_id.h" | |
| 14 #include "ui/gfx/image/image_skia.h" | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 // Fetches from Android side and caches ARC kiosk app data such as name and | |
| 19 // icon. | |
| 20 class ArcKioskAppData : public KioskAppDataBase { | |
| 21 public: | |
| 22 ArcKioskAppData(const std::string& app_id, | |
| 23 const AccountId& account_id, | |
| 24 const std::string& name); | |
| 25 ~ArcKioskAppData() override; | |
| 26 | |
| 27 // TODO(poromov@): Use appropriate app id http://crbug.com/665904 | |
| 28 // Currently app_id is always package_name. | |
| 29 bool operator==(const std::string& other_app_id) const; | |
| 30 | |
| 31 // Loads the locally cached data. Return false if there is none. | |
| 32 bool LoadFromCache(); | |
| 33 | |
| 34 // Sets the cached data. | |
| 35 void SetCache(const std::string& name, const gfx::ImageSkia& icon); | |
| 36 | |
| 37 // Callbacks for KioskAppIconLoader. | |
| 38 void OnIconLoadSuccess(const gfx::ImageSkia& icon) override; | |
| 39 void OnIconLoadFailure() override; | |
| 40 | |
| 41 private: | |
| 42 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppData); | |
| 43 }; | |
| 44 | |
| 45 } // namespace chromeos | |
| 46 | |
| 47 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_ | |
| OLD | NEW |