| 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" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 DEVELOPERPRIVATE_RELOAD); | 270 DEVELOPERPRIVATE_RELOAD); |
| 272 | 271 |
| 273 protected: | 272 protected: |
| 274 ~DeveloperPrivateReloadFunction() override; | 273 ~DeveloperPrivateReloadFunction() override; |
| 275 | 274 |
| 276 // ExtensionFunction: | 275 // ExtensionFunction: |
| 277 ResponseAction Run() override; | 276 ResponseAction Run() override; |
| 278 }; | 277 }; |
| 279 | 278 |
| 280 class DeveloperPrivateShowPermissionsDialogFunction | 279 class DeveloperPrivateShowPermissionsDialogFunction |
| 281 : public ChromeSyncExtensionFunction, | 280 : public DeveloperPrivateAPIFunction { |
| 282 public ExtensionInstallPrompt::Delegate { | |
| 283 public: | 281 public: |
| 284 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", | 282 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", |
| 285 DEVELOPERPRIVATE_PERMISSIONS); | 283 DEVELOPERPRIVATE_PERMISSIONS); |
| 284 DeveloperPrivateShowPermissionsDialogFunction(); |
| 286 | 285 |
| 287 DeveloperPrivateShowPermissionsDialogFunction(); | |
| 288 protected: | 286 protected: |
| 287 // DeveloperPrivateAPIFunction: |
| 289 ~DeveloperPrivateShowPermissionsDialogFunction() override; | 288 ~DeveloperPrivateShowPermissionsDialogFunction() override; |
| 289 ResponseAction Run() override; |
| 290 | 290 |
| 291 // ExtensionFunction: | 291 void Finish(); |
| 292 bool RunSync() override; | |
| 293 | 292 |
| 294 // Overridden from ExtensionInstallPrompt::Delegate | 293 DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateShowPermissionsDialogFunction); |
| 295 void InstallUIProceed() override; | |
| 296 void InstallUIAbort(bool user_initiated) override; | |
| 297 | |
| 298 scoped_ptr<ExtensionInstallPrompt> prompt_; | |
| 299 std::string extension_id_; | |
| 300 }; | 294 }; |
| 301 | 295 |
| 302 class DeveloperPrivateChooseEntryFunction : public UIThreadExtensionFunction, | 296 class DeveloperPrivateChooseEntryFunction : public UIThreadExtensionFunction, |
| 303 public EntryPickerClient { | 297 public EntryPickerClient { |
| 304 protected: | 298 protected: |
| 305 ~DeveloperPrivateChooseEntryFunction() override; | 299 ~DeveloperPrivateChooseEntryFunction() override; |
| 306 bool ShowPicker(ui::SelectFileDialog::Type picker_type, | 300 bool ShowPicker(ui::SelectFileDialog::Type picker_type, |
| 307 const base::string16& select_title, | 301 const base::string16& select_title, |
| 308 const ui::SelectFileDialog::FileTypeInfo& info, | 302 const ui::SelectFileDialog::FileTypeInfo& info, |
| 309 int file_type_index); | 303 int file_type_index); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 protected: | 466 protected: |
| 473 ~DeveloperPrivateOpenDevToolsFunction() override; | 467 ~DeveloperPrivateOpenDevToolsFunction() override; |
| 474 ResponseAction Run() override; | 468 ResponseAction Run() override; |
| 475 }; | 469 }; |
| 476 | 470 |
| 477 } // namespace api | 471 } // namespace api |
| 478 | 472 |
| 479 } // namespace extensions | 473 } // namespace extensions |
| 480 | 474 |
| 481 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 475 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
| OLD | NEW |