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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_
7 7
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" 9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h"
10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" 10 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 // ExtensionFunction: 127 // ExtensionFunction:
128 virtual bool RunImpl() OVERRIDE; 128 virtual bool RunImpl() OVERRIDE;
129 }; 129 };
130 130
131 class DeveloperPrivateGetItemsInfoFunction : public AsyncExtensionFunction { 131 class DeveloperPrivateGetItemsInfoFunction : public AsyncExtensionFunction {
132 public: 132 public:
133 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", 133 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo",
134 DEVELOPERPRIVATE_GETITEMSINFO) 134 DEVELOPERPRIVATE_GETITEMSINFO)
135 135
136 DeveloperPrivateGetItemsInfoFunction();
137
136 protected: 138 protected:
137 virtual ~DeveloperPrivateGetItemsInfoFunction(); 139 virtual ~DeveloperPrivateGetItemsInfoFunction();
138 140
139 // ExtensionFunction: 141 // ExtensionFunction:
140 virtual bool RunImpl() OVERRIDE; 142 virtual bool RunImpl() OVERRIDE;
141 143
142 private: 144 private:
145 // List of extensions/apps items to return. This list will be populated in a
146 // first step. Then, it will be used to keep track of items that need to be
147 // filled with icons.
148 ItemInfoList item_list_;
149
150 // Index of the extension/app in |item_list_| for which we need to load the
151 // icon.
152 int icon_to_load_;
143 153
144 scoped_ptr<developer::ItemInfo> CreateItemInfo( 154 scoped_ptr<developer::ItemInfo> CreateItemInfo(
145 const extensions::Extension& item, 155 const extensions::Extension& item,
146 bool item_is_enabled); 156 bool item_is_enabled);
147 157
148 void GetIconsOnFileThread(
149 ItemInfoList item_list,
150 std::map<std::string, ExtensionResource> itemIdToIconResourceMap);
151
152 // Helper that lists the current inspectable html pages for the extension. 158 // Helper that lists the current inspectable html pages for the extension.
153 void GetInspectablePagesForExtensionProcess( 159 void GetInspectablePagesForExtensionProcess(
154 const Extension* extension, 160 const Extension* extension,
155 const std::set<content::RenderViewHost*>& views, 161 const std::set<content::RenderViewHost*>& views,
156 ItemInspectViewList* result); 162 ItemInspectViewList* result);
157 163
158 ItemInspectViewList GetInspectablePagesForExtension( 164 ItemInspectViewList GetInspectablePagesForExtension(
159 const extensions::Extension* extension, 165 const extensions::Extension* extension,
160 bool extension_is_enabled); 166 bool extension_is_enabled);
161 167
162 void GetShellWindowPagesForExtensionProfile( 168 void GetShellWindowPagesForExtensionProfile(
163 const extensions::Extension* extension, 169 const extensions::Extension* extension,
164 ItemInspectViewList* result); 170 ItemInspectViewList* result);
165 171
166 linked_ptr<developer::ItemInspectView> constructInspectView( 172 linked_ptr<developer::ItemInspectView> constructInspectView(
167 const GURL& url, 173 const GURL& url,
168 int render_process_id, 174 int render_process_id,
169 int render_view_id, 175 int render_view_id,
170 bool incognito, 176 bool incognito,
171 bool generated_background_page); 177 bool generated_background_page);
178
179 // Request the icon of the extension/app at the index |icon_to_load_| in
180 // |item_list_|.
181 void RequestNextIcon();
182
183 // Called when each icon has been loaded by RequestNextIcon(). |url| is the
184 // data url containing the icon.
185 void LoadIconFinished(const GURL& url);
172 }; 186 };
173 187
174 class DeveloperPrivateInspectFunction : public SyncExtensionFunction { 188 class DeveloperPrivateInspectFunction : public SyncExtensionFunction {
175 public: 189 public:
176 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", 190 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect",
177 DEVELOPERPRIVATE_INSPECT) 191 DEVELOPERPRIVATE_INSPECT)
178 192
179 protected: 193 protected:
180 virtual ~DeveloperPrivateInspectFunction(); 194 virtual ~DeveloperPrivateInspectFunction();
181 195
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 437
424 void GetUnpackedExtension(const base::FilePath& path, 438 void GetUnpackedExtension(const base::FilePath& path,
425 const ExtensionSet* extensions); 439 const ExtensionSet* extensions);
426 }; 440 };
427 441
428 } // namespace api 442 } // namespace api
429 443
430 } // namespace extensions 444 } // namespace extensions
431 445
432 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_ 446 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_
OLDNEW
« 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