OLD | NEW |
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 Loading... |
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 | |
138 protected: | 136 protected: |
139 virtual ~DeveloperPrivateGetItemsInfoFunction(); | 137 virtual ~DeveloperPrivateGetItemsInfoFunction(); |
140 | 138 |
141 // ExtensionFunction: | 139 // ExtensionFunction: |
142 virtual bool RunImpl() OVERRIDE; | 140 virtual bool RunImpl() OVERRIDE; |
143 | 141 |
144 private: | 142 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_; | |
153 | 143 |
154 scoped_ptr<developer::ItemInfo> CreateItemInfo( | 144 scoped_ptr<developer::ItemInfo> CreateItemInfo( |
155 const extensions::Extension& item, | 145 const extensions::Extension& item, |
156 bool item_is_enabled); | 146 bool item_is_enabled); |
157 | 147 |
| 148 void GetIconsOnFileThread( |
| 149 ItemInfoList item_list, |
| 150 std::map<std::string, ExtensionResource> itemIdToIconResourceMap); |
| 151 |
158 // Helper that lists the current inspectable html pages for the extension. | 152 // Helper that lists the current inspectable html pages for the extension. |
159 void GetInspectablePagesForExtensionProcess( | 153 void GetInspectablePagesForExtensionProcess( |
160 const Extension* extension, | 154 const Extension* extension, |
161 const std::set<content::RenderViewHost*>& views, | 155 const std::set<content::RenderViewHost*>& views, |
162 ItemInspectViewList* result); | 156 ItemInspectViewList* result); |
163 | 157 |
164 ItemInspectViewList GetInspectablePagesForExtension( | 158 ItemInspectViewList GetInspectablePagesForExtension( |
165 const extensions::Extension* extension, | 159 const extensions::Extension* extension, |
166 bool extension_is_enabled); | 160 bool extension_is_enabled); |
167 | 161 |
168 void GetShellWindowPagesForExtensionProfile( | 162 void GetShellWindowPagesForExtensionProfile( |
169 const extensions::Extension* extension, | 163 const extensions::Extension* extension, |
170 ItemInspectViewList* result); | 164 ItemInspectViewList* result); |
171 | 165 |
172 linked_ptr<developer::ItemInspectView> constructInspectView( | 166 linked_ptr<developer::ItemInspectView> constructInspectView( |
173 const GURL& url, | 167 const GURL& url, |
174 int render_process_id, | 168 int render_process_id, |
175 int render_view_id, | 169 int render_view_id, |
176 bool incognito, | 170 bool incognito, |
177 bool generated_background_page); | 171 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); | |
186 }; | 172 }; |
187 | 173 |
188 class DeveloperPrivateInspectFunction : public SyncExtensionFunction { | 174 class DeveloperPrivateInspectFunction : public SyncExtensionFunction { |
189 public: | 175 public: |
190 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", | 176 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", |
191 DEVELOPERPRIVATE_INSPECT) | 177 DEVELOPERPRIVATE_INSPECT) |
192 | 178 |
193 protected: | 179 protected: |
194 virtual ~DeveloperPrivateInspectFunction(); | 180 virtual ~DeveloperPrivateInspectFunction(); |
195 | 181 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 423 |
438 void GetUnpackedExtension(const base::FilePath& path, | 424 void GetUnpackedExtension(const base::FilePath& path, |
439 const ExtensionSet* extensions); | 425 const ExtensionSet* extensions); |
440 }; | 426 }; |
441 | 427 |
442 } // namespace api | 428 } // namespace api |
443 | 429 |
444 } // namespace extensions | 430 } // namespace extensions |
445 | 431 |
446 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 432 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
OLD | NEW |