| 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_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class PackExtensionHandler : public content::WebUIMessageHandler, | 24 class PackExtensionHandler : public content::WebUIMessageHandler, |
| 25 public ui::SelectFileDialog::Listener, | 25 public ui::SelectFileDialog::Listener, |
| 26 public PackExtensionJob::Client { | 26 public PackExtensionJob::Client { |
| 27 public: | 27 public: |
| 28 PackExtensionHandler(); | 28 PackExtensionHandler(); |
| 29 virtual ~PackExtensionHandler(); | 29 virtual ~PackExtensionHandler(); |
| 30 | 30 |
| 31 void GetLocalizedValues(content::WebUIDataSource* source); | 31 void GetLocalizedValues(content::WebUIDataSource* source); |
| 32 | 32 |
| 33 // WebUIMessageHandler implementation. | 33 // WebUIMessageHandler implementation. |
| 34 virtual void RegisterMessages() OVERRIDE; | 34 virtual void RegisterMessages() override; |
| 35 | 35 |
| 36 // ExtensionPackJob::Client implementation. | 36 // ExtensionPackJob::Client implementation. |
| 37 virtual void OnPackSuccess(const base::FilePath& crx_file, | 37 virtual void OnPackSuccess(const base::FilePath& crx_file, |
| 38 const base::FilePath& key_file) OVERRIDE; | 38 const base::FilePath& key_file) override; |
| 39 | 39 |
| 40 virtual void OnPackFailure(const std::string& error, | 40 virtual void OnPackFailure(const std::string& error, |
| 41 ExtensionCreator::ErrorType) OVERRIDE; | 41 ExtensionCreator::ErrorType) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // SelectFileDialog::Listener implementation. | 44 // SelectFileDialog::Listener implementation. |
| 45 virtual void FileSelected(const base::FilePath& path, | 45 virtual void FileSelected(const base::FilePath& path, |
| 46 int index, void* params) OVERRIDE; | 46 int index, void* params) override; |
| 47 virtual void MultiFilesSelected( | 47 virtual void MultiFilesSelected( |
| 48 const std::vector<base::FilePath>& files, void* params) OVERRIDE; | 48 const std::vector<base::FilePath>& files, void* params) override; |
| 49 virtual void FileSelectionCanceled(void* params) OVERRIDE {} | 49 virtual void FileSelectionCanceled(void* params) override {} |
| 50 | 50 |
| 51 // JavaScript callback to start packing an extension. | 51 // JavaScript callback to start packing an extension. |
| 52 void HandlePackMessage(const base::ListValue* args); | 52 void HandlePackMessage(const base::ListValue* args); |
| 53 | 53 |
| 54 // JavaScript callback to show a file browse dialog. | 54 // JavaScript callback to show a file browse dialog. |
| 55 // |args[0]| must be a string that specifies the file dialog type: file or | 55 // |args[0]| must be a string that specifies the file dialog type: file or |
| 56 // folder. | 56 // folder. |
| 57 // |args[1]| must be a string that specifies the operation to perform: load | 57 // |args[1]| must be a string that specifies the operation to perform: load |
| 58 // or pem. | 58 // or pem. |
| 59 void HandleSelectFilePathMessage(const base::ListValue* args); | 59 void HandleSelectFilePathMessage(const base::ListValue* args); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 76 | 76 |
| 77 // Path to the last used folder to load an extension. | 77 // Path to the last used folder to load an extension. |
| 78 base::FilePath last_used_path_; | 78 base::FilePath last_used_path_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(PackExtensionHandler); | 80 DISALLOW_COPY_AND_ASSIGN(PackExtensionHandler); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace extensions | 83 } // namespace extensions |
| 84 | 84 |
| 85 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 85 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
| OLD | NEW |