 Chromium Code Reviews
 Chromium Code Reviews Issue 11794034:
  Adds functionality to pack an extension / app from the app.  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@bacha_lo
    
  
    Issue 11794034:
  Adds functionality to pack an extension / app from the app.  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@bacha_lo| 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 5a1780c9a0dc6b27f0cbf497efc6916bf8f201b7..82c16edabcb31da90979ddc2fcb84ecd9196fd17 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" | 
| @@ -229,18 +230,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); | 
| + virtual void FileSelectionCanceled(); | 
| private: | 
| }; | 
| @@ -253,6 +257,44 @@ class DeveloperPrivateLoadUnpackedFunction | 
| protected: | 
| virtual ~DeveloperPrivateLoadUnpackedFunction(); | 
| virtual bool RunImpl() OVERRIDE; | 
| +}; | 
| + | 
| +class DeveloperPrivateChooseItemFunction | 
| + : public DeveloperPrivateChooseEntryFunction { | 
| 
asargent_no_longer_on_chrome
2013/01/09 00:48:05
I'm a little wary of using inheritance of another
 
miket_OOO
2013/01/09 18:52:41
I agree with Antony's suggestion. This kind of inh
 
Gaurav
2013/01/12 01:08:26
Done.
 
Gaurav
2013/01/12 01:08:26
Done.
 | 
| + public: | 
| + DECLARE_EXTENSION_FUNCTION_NAME("developerPrivate.chooseItem"); | 
| + | 
| + protected: | 
| + virtual ~DeveloperPrivateChooseItemFunction(); | 
| + virtual bool RunImpl() OVERRIDE; | 
| + | 
| + virtual void FileSelected(const FilePath& path) OVERRIDE; | 
| + virtual void FileSelectionCanceled() OVERRIDE; | 
| +}; | 
| + | 
| +class DeveloperPrivatePackItemFunction | 
| + : public AsyncExtensionFunction, | 
| + public extensions::PackExtensionJob::Client { | 
| + | 
| + public: | 
| + DECLARE_EXTENSION_FUNCTION_NAME("developerPrivate.packItem"); | 
| + | 
| + DeveloperPrivatePackItemFunction(); | 
| + | 
| + // 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) OVERRIDE; | 
| 
miket_OOO
2013/01/09 18:52:41
Even if you don't need it, please include a parame
 
Gaurav
2013/01/12 01:08:26
Done.
 | 
| + | 
| + protected: | 
| + virtual ~DeveloperPrivatePackItemFunction(); | 
| + virtual bool RunImpl() OVERRIDE; | 
| + | 
| + private: | 
| + scoped_refptr<extensions::PackExtensionJob> pack_job_; | 
| + std::string item_path_str_; | 
| + std::string key_path_str_; | 
| }; |