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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
12 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" | 12 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" |
13 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 13 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
14 #include "chrome/browser/extensions/chrome_extension_function.h" | 14 #include "chrome/browser/extensions/chrome_extension_function.h" |
15 #include "chrome/browser/extensions/error_console/error_console.h" | 15 #include "chrome/browser/extensions/error_console/error_console.h" |
16 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 16 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
17 #include "chrome/browser/extensions/pack_extension_job.h" | 17 #include "chrome/browser/extensions/pack_extension_job.h" |
| 18 #include "chrome/common/extensions/webstore_install_result.h" |
18 #include "extensions/browser/browser_context_keyed_api_factory.h" | 19 #include "extensions/browser/browser_context_keyed_api_factory.h" |
19 #include "extensions/browser/event_router.h" | 20 #include "extensions/browser/event_router.h" |
20 #include "extensions/browser/extension_registry_observer.h" | 21 #include "extensions/browser/extension_registry_observer.h" |
21 #include "extensions/browser/process_manager_observer.h" | 22 #include "extensions/browser/process_manager_observer.h" |
22 #include "storage/browser/fileapi/file_system_context.h" | 23 #include "storage/browser/fileapi/file_system_context.h" |
23 #include "storage/browser/fileapi/file_system_operation.h" | 24 #include "storage/browser/fileapi/file_system_operation.h" |
24 #include "ui/shell_dialogs/select_file_dialog.h" | 25 #include "ui/shell_dialogs/select_file_dialog.h" |
25 | 26 |
26 class Profile; | 27 class Profile; |
27 | 28 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 168 |
168 namespace api { | 169 namespace api { |
169 | 170 |
170 class DeveloperPrivateAPIFunction : public ChromeUIThreadExtensionFunction { | 171 class DeveloperPrivateAPIFunction : public ChromeUIThreadExtensionFunction { |
171 protected: | 172 protected: |
172 ~DeveloperPrivateAPIFunction() override; | 173 ~DeveloperPrivateAPIFunction() override; |
173 | 174 |
174 // Returns the extension with the given |id| from the registry, including | 175 // Returns the extension with the given |id| from the registry, including |
175 // all possible extensions (enabled, disabled, terminated, etc). | 176 // all possible extensions (enabled, disabled, terminated, etc). |
176 const Extension* GetExtensionById(const std::string& id); | 177 const Extension* GetExtensionById(const std::string& id); |
| 178 |
| 179 // Returns the extension with the given |id| from the registry, only checking |
| 180 // enabled extensions. |
| 181 const Extension* GetEnabledExtensionById(const std::string& id); |
177 }; | 182 }; |
178 | 183 |
179 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { | 184 class DeveloperPrivateAutoUpdateFunction : public DeveloperPrivateAPIFunction { |
180 public: | 185 public: |
181 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", | 186 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", |
182 DEVELOPERPRIVATE_AUTOUPDATE) | 187 DEVELOPERPRIVATE_AUTOUPDATE) |
183 | 188 |
184 protected: | 189 protected: |
185 ~DeveloperPrivateAutoUpdateFunction() override; | 190 ~DeveloperPrivateAutoUpdateFunction() override; |
186 | 191 ResponseAction Run() override; |
187 // ExtensionFunction: | |
188 bool RunSync() override; | |
189 }; | 192 }; |
190 | 193 |
191 class DeveloperPrivateGetItemsInfoFunction | 194 class DeveloperPrivateGetItemsInfoFunction |
192 : public DeveloperPrivateAPIFunction { | 195 : public DeveloperPrivateAPIFunction { |
193 public: | 196 public: |
194 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", | 197 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", |
195 DEVELOPERPRIVATE_GETITEMSINFO) | 198 DEVELOPERPRIVATE_GETITEMSINFO) |
196 DeveloperPrivateGetItemsInfoFunction(); | 199 DeveloperPrivateGetItemsInfoFunction(); |
197 | 200 |
198 private: | 201 private: |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 : public DeveloperPrivateAPIFunction { | 472 : public DeveloperPrivateAPIFunction { |
470 public: | 473 public: |
471 DECLARE_EXTENSION_FUNCTION("developerPrivate.deleteExtensionErrors", | 474 DECLARE_EXTENSION_FUNCTION("developerPrivate.deleteExtensionErrors", |
472 DEVELOPERPRIVATE_DELETEEXTENSIONERRORS); | 475 DEVELOPERPRIVATE_DELETEEXTENSIONERRORS); |
473 | 476 |
474 protected: | 477 protected: |
475 ~DeveloperPrivateDeleteExtensionErrorsFunction() override; | 478 ~DeveloperPrivateDeleteExtensionErrorsFunction() override; |
476 ResponseAction Run() override; | 479 ResponseAction Run() override; |
477 }; | 480 }; |
478 | 481 |
| 482 class DeveloperPrivateRepairExtensionFunction |
| 483 : public DeveloperPrivateAPIFunction { |
| 484 public: |
| 485 DECLARE_EXTENSION_FUNCTION("developerPrivate.repairExtension", |
| 486 DEVELOPERPRIVATE_REPAIREXTENSION); |
| 487 |
| 488 protected: |
| 489 ~DeveloperPrivateRepairExtensionFunction() override; |
| 490 ResponseAction Run() override; |
| 491 |
| 492 void OnReinstallComplete(bool success, |
| 493 const std::string& error, |
| 494 webstore_install::Result result); |
| 495 }; |
| 496 |
| 497 class DeveloperPrivateShowOptionsFunction : public DeveloperPrivateAPIFunction { |
| 498 public: |
| 499 DECLARE_EXTENSION_FUNCTION("developerPrivate.showOptions", |
| 500 DEVELOPERPRIVATE_SHOWOPTIONS); |
| 501 |
| 502 protected: |
| 503 ~DeveloperPrivateShowOptionsFunction() override; |
| 504 ResponseAction Run() override; |
| 505 }; |
| 506 |
| 507 class DeveloperPrivateShowPathFunction : public DeveloperPrivateAPIFunction { |
| 508 public: |
| 509 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPath", |
| 510 DEVELOPERPRIVATE_SHOWPATH); |
| 511 |
| 512 protected: |
| 513 ~DeveloperPrivateShowPathFunction() override; |
| 514 ResponseAction Run() override; |
| 515 }; |
| 516 |
479 } // namespace api | 517 } // namespace api |
480 | 518 |
481 } // namespace extensions | 519 } // namespace extensions |
482 | 520 |
483 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 521 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
OLD | NEW |