| 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_install_prompt.h" | |
| 17 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 16 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 18 #include "chrome/browser/extensions/pack_extension_job.h" | 17 #include "chrome/browser/extensions/pack_extension_job.h" |
| 19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 21 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 22 #include "extensions/browser/browser_context_keyed_api_factory.h" | 21 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 23 #include "extensions/browser/event_router.h" | 22 #include "extensions/browser/event_router.h" |
| 24 #include "extensions/browser/extension_registry_observer.h" | 23 #include "extensions/browser/extension_registry_observer.h" |
| 25 #include "storage/browser/fileapi/file_system_context.h" | 24 #include "storage/browser/fileapi/file_system_context.h" |
| 26 #include "storage/browser/fileapi/file_system_operation.h" | 25 #include "storage/browser/fileapi/file_system_operation.h" |
| 27 #include "ui/shell_dialogs/select_file_dialog.h" | 26 #include "ui/shell_dialogs/select_file_dialog.h" |
| 28 | 27 |
| 29 class Profile; | 28 class Profile; |
| 30 | 29 |
| 31 namespace extensions { | 30 namespace extensions { |
| 32 | 31 |
| 33 class ExtensionError; | 32 class ExtensionError; |
| 34 class ExtensionRegistry; | 33 class ExtensionRegistry; |
| 35 class ExtensionSystem; | 34 class ExtensionSystem; |
| 36 class ManagementPolicy; | 35 class ManagementPolicy; |
| 37 class RequirementsChecker; | 36 class RequirementsChecker; |
| 37 class ShowPermissionsDialogHelper; |
| 38 | 38 |
| 39 namespace api { | 39 namespace api { |
| 40 | 40 |
| 41 class EntryPicker; | 41 class EntryPicker; |
| 42 class EntryPickerClient; | 42 class EntryPickerClient; |
| 43 | 43 |
| 44 namespace developer_private { | 44 namespace developer_private { |
| 45 | 45 |
| 46 struct ItemInfo; | 46 struct ItemInfo; |
| 47 struct ItemInspectView; | 47 struct ItemInspectView; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 DEVELOPERPRIVATE_RELOAD); | 271 DEVELOPERPRIVATE_RELOAD); |
| 272 | 272 |
| 273 protected: | 273 protected: |
| 274 ~DeveloperPrivateReloadFunction() override; | 274 ~DeveloperPrivateReloadFunction() override; |
| 275 | 275 |
| 276 // ExtensionFunction: | 276 // ExtensionFunction: |
| 277 ResponseAction Run() override; | 277 ResponseAction Run() override; |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 class DeveloperPrivateShowPermissionsDialogFunction | 280 class DeveloperPrivateShowPermissionsDialogFunction |
| 281 : public ChromeSyncExtensionFunction, | 281 : public DeveloperPrivateAPIFunction { |
| 282 public ExtensionInstallPrompt::Delegate { | |
| 283 public: | 282 public: |
| 284 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", | 283 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", |
| 285 DEVELOPERPRIVATE_PERMISSIONS); | 284 DEVELOPERPRIVATE_PERMISSIONS); |
| 285 DeveloperPrivateShowPermissionsDialogFunction(); |
| 286 | 286 |
| 287 DeveloperPrivateShowPermissionsDialogFunction(); | |
| 288 protected: | 287 protected: |
| 288 // DeveloperPrivateAPIFunction: |
| 289 ~DeveloperPrivateShowPermissionsDialogFunction() override; | 289 ~DeveloperPrivateShowPermissionsDialogFunction() override; |
| 290 ResponseAction Run() override; |
| 290 | 291 |
| 291 // ExtensionFunction: | 292 void Finish(); |
| 292 bool RunSync() override; | |
| 293 | 293 |
| 294 // Overridden from ExtensionInstallPrompt::Delegate | 294 scoped_ptr<ShowPermissionsDialogHelper> show_permissions_dialog_helper_; |
| 295 void InstallUIProceed() override; | |
| 296 void InstallUIAbort(bool user_initiated) override; | |
| 297 | 295 |
| 298 scoped_ptr<ExtensionInstallPrompt> prompt_; | 296 DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateShowPermissionsDialogFunction); |
| 299 std::string extension_id_; | |
| 300 }; | 297 }; |
| 301 | 298 |
| 302 class DeveloperPrivateChooseEntryFunction : public UIThreadExtensionFunction, | 299 class DeveloperPrivateChooseEntryFunction : public UIThreadExtensionFunction, |
| 303 public EntryPickerClient { | 300 public EntryPickerClient { |
| 304 protected: | 301 protected: |
| 305 ~DeveloperPrivateChooseEntryFunction() override; | 302 ~DeveloperPrivateChooseEntryFunction() override; |
| 306 bool ShowPicker(ui::SelectFileDialog::Type picker_type, | 303 bool ShowPicker(ui::SelectFileDialog::Type picker_type, |
| 307 const base::string16& select_title, | 304 const base::string16& select_title, |
| 308 const ui::SelectFileDialog::FileTypeInfo& info, | 305 const ui::SelectFileDialog::FileTypeInfo& info, |
| 309 int file_type_index); | 306 int file_type_index); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 protected: | 469 protected: |
| 473 ~DeveloperPrivateOpenDevToolsFunction() override; | 470 ~DeveloperPrivateOpenDevToolsFunction() override; |
| 474 ResponseAction Run() override; | 471 ResponseAction Run() override; |
| 475 }; | 472 }; |
| 476 | 473 |
| 477 } // namespace api | 474 } // namespace api |
| 478 | 475 |
| 479 } // namespace extensions | 476 } // namespace extensions |
| 480 | 477 |
| 481 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 478 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
| OLD | NEW |