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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_app_data.h

Issue 2778053002: Fetch ARC Kiosk app name and icon from Android side. (Closed)
Patch Set: extract common code into KioskAppDataBase Created 3 years, 9 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/kiosk_app_data.h
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.h b/chrome/browser/chromeos/app_mode/kiosk_app_data.h
index 7f5d5c9dd596a2237fac5a75899c358425674afe..c9fba1de7260342bf447bd574a5e8f6629b5d9ef 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_data.h
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.h
@@ -10,8 +10,8 @@
#include "base/files/file_path.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/app_mode/kiosk_app_data_base.h"
#include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
#include "components/signin/core/account_id/account_id.h"
#include "ui/gfx/image/image_skia.h"
Luis Héctor Chávez 2017/03/30 16:49:54 unused?
Sergey Poromov 2017/03/30 18:22:07 Done.
@@ -38,7 +38,8 @@ class KioskAppDataDelegate;
// Fetches an app's web store data and manages the cached info such as name
// and icon.
-class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
+class KioskAppData : public KioskAppDataBase,
+ public base::SupportsWeakPtr<KioskAppData>,
xiyuan 2017/03/30 16:46:59 Can we remove this inheritance since KioskAppDataB
Sergey Poromov 2017/03/30 18:22:06 Done.
public extensions::WebstoreDataFetcherDelegate {
public:
enum Status {
@@ -59,9 +60,6 @@ class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
// from web store.
void Load();
- // Clears locally cached data.
- void ClearCache();
-
// Loads app data from the app installed in the given profile.
void LoadFromInstalledApp(Profile* profile, const extensions::Extension* app);
@@ -75,11 +73,7 @@ class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
// Returns true if the update url points to Webstore.
bool IsFromWebStore() const;
- const std::string& app_id() const { return app_id_; }
- const AccountId& account_id() const { return account_id_; }
- const std::string& name() const { return name_; }
const GURL& update_url() const { return update_url_; }
- const gfx::ImageSkia& icon() const { return icon_; }
const std::string& required_platform_version() const {
return required_platform_version_;
}
@@ -94,9 +88,12 @@ class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
const GURL& update_url,
const std::string& required_platform_version);
+ // Callbacks for KioskAppIconLoader.
+ void OnIconLoadSuccess(const gfx::ImageSkia& icon) override;
+ void OnIconLoadFailure() override;
+
private:
class CrxLoader;
- class IconLoader;
class WebstoreDataParser;
void SetStatus(Status status);
@@ -104,26 +101,19 @@ class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
// Returns URLRequestContextGetter to use for fetching web store data.
net::URLRequestContextGetter* GetRequestContextGetter();
+ const char* kiosk_dictionary_name() const override;
+
// Loads the locally cached data. Return false if there is none.
bool LoadFromCache();
// Sets the cached data.
void SetCache(const std::string& name,
- const base::FilePath& icon_path,
- const std::string& required_platform_version);
-
- // Helper to set the cached data using a SkBitmap icon.
- void SetCache(const std::string& name,
const SkBitmap& icon,
const std::string& required_platform_version);
// Callback for extensions::ImageLoader.
void OnExtensionIconLoaded(const gfx::Image& icon);
- // Callbacks for IconLoader.
- void OnIconLoadSuccess(const gfx::ImageSkia& icon);
- void OnIconLoadFailure();
-
// Callbacks for WebstoreDataParser
void OnWebstoreParseSuccess(const SkBitmap& icon,
const std::string& required_platform_version);
@@ -154,15 +144,10 @@ class KioskAppData : public base::SupportsWeakPtr<KioskAppData>,
KioskAppDataDelegate* delegate_; // not owned.
Status status_;
- std::string app_id_;
- AccountId account_id_;
- std::string name_;
GURL update_url_;
- gfx::ImageSkia icon_;
std::string required_platform_version_;
std::unique_ptr<extensions::WebstoreDataFetcher> webstore_fetcher_;
- base::FilePath icon_path_;
base::FilePath crx_file_;

Powered by Google App Engine
This is Rietveld 408576698