Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4789)

Unified Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h

Issue 2778053002: Fetch ARC Kiosk app name and icon from Android side. (Closed)
Patch Set: some nits Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h
diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..428af43cbc81576866dd072caff49694d8f1015b
--- /dev/null
+++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_
+#define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_
+
+#include <string>
+
+#include "base/files/file_path.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/app_mode/kiosk_app_data_base.h"
+#include "components/signin/core/account_id/account_id.h"
+#include "ui/gfx/image/image_skia.h"
+
+namespace chromeos {
+
+// Fetches from Android side and caches ARC kiosk app data such as name and
+// icon.
+class ArcKioskAppData : public KioskAppDataBase {
+ public:
+ ArcKioskAppData(const std::string& app_id,
+ const AccountId& account_id,
+ const std::string& name);
+ ~ArcKioskAppData() override;
+
+ // TODO(poromov@): Use appropriate app id http://crbug.com/665904
+ // Currently app_id is always package_name.
+ bool operator==(const std::string& other_app_id) const;
+
+ // Loads the locally cached data. Return false if there is none.
+ bool LoadFromCache();
+
+ // Sets the cached data.
+ void SetCache(const std::string& name, const gfx::ImageSkia& icon);
+
+ // Callbacks for KioskAppIconLoader.
+ void OnIconLoadSuccess(const gfx::ImageSkia& icon) override;
+ void OnIconLoadFailure() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ArcKioskAppData);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698