| 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 |
| 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. |
| 146 ItemInfoList item_list_; |
| 147 |
| 148 // Index of the extension/app in |item_list_| for which we need to load the |
| 149 // icon. |
| 150 int icon_to_load_; |
| 143 | 151 |
| 144 scoped_ptr<developer::ItemInfo> CreateItemInfo( | 152 scoped_ptr<developer::ItemInfo> CreateItemInfo( |
| 145 const extensions::Extension& item, | 153 const extensions::Extension& item, |
| 146 bool item_is_enabled); | 154 bool item_is_enabled); |
| 147 | 155 |
| 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. | 156 // Helper that lists the current inspectable html pages for the extension. |
| 153 void GetInspectablePagesForExtensionProcess( | 157 void GetInspectablePagesForExtensionProcess( |
| 154 const Extension* extension, | 158 const Extension* extension, |
| 155 const std::set<content::RenderViewHost*>& views, | 159 const std::set<content::RenderViewHost*>& views, |
| 156 ItemInspectViewList* result); | 160 ItemInspectViewList* result); |
| 157 | 161 |
| 158 ItemInspectViewList GetInspectablePagesForExtension( | 162 ItemInspectViewList GetInspectablePagesForExtension( |
| 159 const extensions::Extension* extension, | 163 const extensions::Extension* extension, |
| 160 bool extension_is_enabled); | 164 bool extension_is_enabled); |
| 161 | 165 |
| 162 void GetShellWindowPagesForExtensionProfile( | 166 void GetShellWindowPagesForExtensionProfile( |
| 163 const extensions::Extension* extension, | 167 const extensions::Extension* extension, |
| 164 ItemInspectViewList* result); | 168 ItemInspectViewList* result); |
| 165 | 169 |
| 166 linked_ptr<developer::ItemInspectView> constructInspectView( | 170 linked_ptr<developer::ItemInspectView> constructInspectView( |
| 167 const GURL& url, | 171 const GURL& url, |
| 168 int render_process_id, | 172 int render_process_id, |
| 169 int render_view_id, | 173 int render_view_id, |
| 170 bool incognito, | 174 bool incognito, |
| 171 bool generated_background_page); | 175 bool generated_background_page); |
| 176 |
| 177 // Request the icon of the extension/app at the index |icon_to_load_| in |
| 178 // |item_list_|. |
| 179 void RequestNextIcon(); |
| 180 |
| 181 // Called when each icon has been loaded by RequestNextIcon(). |url| is the |
| 182 // data url containing the icon. |
| 183 void LoadIconFinished(const GURL& url); |
| 172 }; | 184 }; |
| 173 | 185 |
| 174 class DeveloperPrivateInspectFunction : public SyncExtensionFunction { | 186 class DeveloperPrivateInspectFunction : public SyncExtensionFunction { |
| 175 public: | 187 public: |
| 176 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", | 188 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", |
| 177 DEVELOPERPRIVATE_INSPECT) | 189 DEVELOPERPRIVATE_INSPECT) |
| 178 | 190 |
| 179 protected: | 191 protected: |
| 180 virtual ~DeveloperPrivateInspectFunction(); | 192 virtual ~DeveloperPrivateInspectFunction(); |
| 181 | 193 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 435 |
| 424 void GetUnpackedExtension(const base::FilePath& path, | 436 void GetUnpackedExtension(const base::FilePath& path, |
| 425 const ExtensionSet* extensions); | 437 const ExtensionSet* extensions); |
| 426 }; | 438 }; |
| 427 | 439 |
| 428 } // namespace api | 440 } // namespace api |
| 429 | 441 |
| 430 } // namespace extensions | 442 } // namespace extensions |
| 431 | 443 |
| 432 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 444 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
| OLD | NEW |