Chromium Code Reviews| Index: chrome/browser/extensions/api/developer_private/developer_private_api.h |
| diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h |
| index 15f9a5c61ffb08a775053bbd7b74200b2fc12de8..c1b26fcf72311a31079aa263f7905bcd55168153 100644 |
| --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h |
| +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h |
| @@ -10,6 +10,7 @@ |
| #include "chrome/browser/extensions/extension_function.h" |
| #include "chrome/browser/extensions/extension_install_prompt.h" |
| #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| +#include "chrome/browser/extensions/pack_extension_job.h" |
| #include "chrome/browser/extensions/requirements_checker.h" |
| #include "chrome/browser/profiles/profile_keyed_service.h" |
| #include "content/public/browser/notification_observer.h" |
| @@ -60,7 +61,7 @@ class DeveloperPrivateAPI : public ProfileKeyedService, |
| void SetLastUnpackedDirectory(const FilePath& path); |
| - FilePath& getLastUnpackedDirectory() { return last_unpacked_directory_; } |
| + FilePath& GetLastUnpackedDirectory() { return last_unpacked_directory_; } |
| // ProfileKeyedService implementation |
| virtual void Shutdown() OVERRIDE; |
| @@ -195,16 +196,18 @@ class DeveloperPrivateEnableFunction |
| scoped_ptr<extensions::RequirementsChecker> requirements_checker_; |
| }; |
| -class DeveloperPrivateChooseEntryFunction : public SyncExtensionFunction, |
| +class DeveloperPrivateChooseEntryFunction : public AsyncExtensionFunction, |
| public EntryPickerClient { |
| protected: |
| virtual ~DeveloperPrivateChooseEntryFunction(); |
| virtual bool RunImpl() OVERRIDE; |
| bool ShowPicker(ui::SelectFileDialog::Type picker_type, |
| const FilePath& last_directory, |
| - const string16& select_title); |
| + const string16& select_title, |
| + const ui::SelectFileDialog::FileTypeInfo& info, |
| + int file_type_index); |
| - // EntryPickerCLient functions. |
| + // EntryPickerClient functions. |
| virtual void FileSelected(const FilePath& path) = 0; |
| virtual void FileSelectionCanceled() = 0; |
| }; |
| @@ -223,7 +226,48 @@ class DeveloperPrivateLoadUnpackedFunction |
| // EntryPickerCLient implementation. |
| virtual void FileSelected(const FilePath& path) OVERRIDE; |
| virtual void FileSelectionCanceled() OVERRIDE; |
| +}; |
| + |
| +class DeveloperPrivateChoosePathFunction |
| + : public DeveloperPrivateChooseEntryFunction { |
| + public: |
| + DECLARE_EXTENSION_FUNCTION("developerPrivate.choosePath", |
| + DEVELOPERPRIVATE_CHOOSEPATH); |
| + |
| + protected: |
| + virtual ~DeveloperPrivateChoosePathFunction(); |
| + virtual bool RunImpl() OVERRIDE; |
| + |
| + // EntryPickerClient functions. |
| + virtual void FileSelected(const FilePath& path) OVERRIDE; |
| + virtual void FileSelectionCanceled() OVERRIDE; |
| +}; |
| + |
| +class DeveloperPrivatePackDirectoryFunction |
| + : public AsyncExtensionFunction, |
| + public extensions::PackExtensionJob::Client { |
| + |
| + public: |
| + DECLARE_EXTENSION_FUNCTION("developerPrivate.packDirectory", |
| + DEVELOPERPRIVATE_PACKDIRECTORY); |
| + |
| + DeveloperPrivatePackDirectoryFunction(); |
| + // ExtensionPackJob::Client implementation. |
| + virtual void OnPackSuccess(const FilePath& crx_file, |
| + const FilePath& key_file) OVERRIDE; |
| + virtual void OnPackFailure( |
| + const std::string& error, |
| + extensions::ExtensionCreator::ErrorType error_type) OVERRIDE; |
| + |
| + protected: |
| + virtual ~DeveloperPrivatePackDirectoryFunction(); |
| + virtual bool RunImpl() OVERRIDE; |
| + |
| + private: |
| + scoped_refptr<extensions::PackExtensionJob> pack_job_; |
| + std::string item_path_str_; |
| + std::string key_path_str_; |
|
asargent_no_longer_on_chrome
2013/02/09 00:38:45
naming suggestion: consider omitting the "_str" pa
Gaurav
2013/02/11 20:01:55
Added str as when they are used they might be conf
asargent_no_longer_on_chrome
2013/02/11 20:07:27
Yep, I assumed that's why you had that suffix. If
|
| }; |
| class DeveloperPrivateGetStringsFunction : public SyncExtensionFunction { |