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 ea939eed1ecdf421d7fc907acbd5ecdf6382fe2e..e7b42b4ba19a64942c17db94012bebf15e1011ce 100644 |
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.h |
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h |
@@ -9,6 +9,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" |
@@ -63,7 +64,7 @@ class DeveloperPrivateAPI : public ProfileKeyedService, |
void LoadUnpacked(const FilePath& path); |
- FilePath& getLastUnpackedDirectory() { return last_unpacked_directory_; } |
+ FilePath& GetLastUnpackedDirectory() { return last_unpacked_directory_; } |
bool UninstallItem(const std::string extension_id, Browser* browser); |
@@ -226,18 +227,21 @@ class DeveloperPrivateUninstallFunction : public SyncExtensionFunction { |
virtual bool RunImpl() OVERRIDE; |
}; |
-class DeveloperPrivateChooseEntryFunction : public SyncExtensionFunction { |
+class DeveloperPrivateChooseEntryFunction : public AsyncExtensionFunction { |
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 |
+ ); |
friend EntryPicker; |
// FileSelected and FileSelectionCanceled are called by the entry picker. |
- void FileSelected(const FilePath& path); |
- void FileSelectionCanceled(); |
+ virtual void FileSelected(const FilePath& path) = 0; |
+ virtual void FileSelectionCanceled() = 0; |
private: |
}; |
@@ -251,6 +255,48 @@ class DeveloperPrivateLoadUnpackedFunction |
virtual ~DeveloperPrivateLoadUnpackedFunction(); |
virtual bool RunImpl() OVERRIDE; |
+ virtual void FileSelected(const FilePath& path) OVERRIDE; |
+ virtual void FileSelectionCanceled() OVERRIDE; |
+}; |
+ |
+class DeveloperPrivateChoosePathFunction |
+ : public DeveloperPrivateChooseEntryFunction { |
+ public: |
+ DECLARE_EXTENSION_FUNCTION_NAME("developerPrivate.choosePath"); |
+ |
+ protected: |
+ virtual ~DeveloperPrivateChoosePathFunction(); |
+ virtual bool RunImpl() OVERRIDE; |
+ |
+ virtual void FileSelected(const FilePath& path) OVERRIDE; |
+ virtual void FileSelectionCanceled() OVERRIDE; |
+}; |
+ |
+class DeveloperPrivatePackDirectoryFunction |
+ : public AsyncExtensionFunction, |
+ public extensions::PackExtensionJob::Client { |
+ |
+ public: |
+ DECLARE_EXTENSION_FUNCTION_NAME("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_; |
+ |
}; |
class DeveloperPrivateGetStringsFunction : public SyncExtensionFunction { |