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

Unified Diff: chrome/browser/extensions/api/developer_private/developer_private_api.h

Issue 25050005: Refactored loading of applications / extensions icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/developer_private/developer_private_api.h
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h
index ac5dc5c5ca828a5ac6bd3d232c11cb3861377b58..41d5a7f2699f4b4a46b7944fcf3dfbb4573e680f 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.h
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h
@@ -133,6 +133,8 @@ class DeveloperPrivateGetItemsInfoFunction : public AsyncExtensionFunction {
DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo",
DEVELOPERPRIVATE_GETITEMSINFO)
+ DeveloperPrivateGetItemsInfoFunction();
+
protected:
virtual ~DeveloperPrivateGetItemsInfoFunction();
@@ -140,15 +142,19 @@ class DeveloperPrivateGetItemsInfoFunction : public AsyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
private:
+ // List of extensions/apps items to return. This list will be populated in a
+ // first step. Then, it will be used to keep track of items that need to be
+ // filled with icons.
+ ItemInfoList item_list_;
+
+ // Index of the extension/app in |item_list_| for which we need to load the
+ // icon.
+ int icon_to_load_;
scoped_ptr<developer::ItemInfo> CreateItemInfo(
const extensions::Extension& item,
bool item_is_enabled);
- void GetIconsOnFileThread(
- ItemInfoList item_list,
- std::map<std::string, ExtensionResource> itemIdToIconResourceMap);
-
// Helper that lists the current inspectable html pages for the extension.
void GetInspectablePagesForExtensionProcess(
const Extension* extension,
@@ -169,6 +175,14 @@ class DeveloperPrivateGetItemsInfoFunction : public AsyncExtensionFunction {
int render_view_id,
bool incognito,
bool generated_background_page);
+
+ // Request the icon of the extension/app at the index |icon_to_load_| in
+ // |item_list_|.
+ void RequestNextIcon();
+
+ // Called when each icon has been loaded by RequestNextIcon(). |url| is the
+ // data url containing the icon.
+ void LoadIconFinished(const GURL& url);
};
class DeveloperPrivateInspectFunction : public SyncExtensionFunction {
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698