| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_PACK_EXTENSION_JOB_UI_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_UI_H_ |
| 7 |
| 5 #include <string> | 8 #include <string> |
| 6 | 9 |
| 7 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 8 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 9 | 12 |
| 10 class MessageLoop; | 13 class MessageLoop; |
| 11 | 14 |
| 12 // Manages packing an extension on the file thread and reporting the result | 15 // Manages packing an extension on the file thread and reporting the result |
| 13 // back to the UI. | 16 // back to the UI. |
| 14 class PackExtensionJob : public base::RefCounted<PackExtensionJob> { | 17 class PackExtensionJob : public base::RefCountedThreadSafe<PackExtensionJob> { |
| 15 public: | 18 public: |
| 16 | 19 |
| 17 // Interface for people who want to use PackExtensionJob to implement. | 20 // Interface for people who want to use PackExtensionJob to implement. |
| 18 class Client { | 21 class Client { |
| 19 public: | 22 public: |
| 20 virtual void OnPackSuccess(const FilePath& crx_file, | 23 virtual void OnPackSuccess(const FilePath& crx_file, |
| 21 const FilePath& key_file) = 0; | 24 const FilePath& key_file) = 0; |
| 22 virtual void OnPackFailure(const std::wstring& message) = 0; | 25 virtual void OnPackFailure(const std::wstring& message) = 0; |
| 23 }; | 26 }; |
| 24 | 27 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 MessageLoop* ui_loop_; | 42 MessageLoop* ui_loop_; |
| 40 MessageLoop* file_loop_; | 43 MessageLoop* file_loop_; |
| 41 Client* client_; | 44 Client* client_; |
| 42 FilePath root_directory_; | 45 FilePath root_directory_; |
| 43 FilePath key_file_; | 46 FilePath key_file_; |
| 44 FilePath crx_file_out_; | 47 FilePath crx_file_out_; |
| 45 FilePath key_file_out_; | 48 FilePath key_file_out_; |
| 46 | 49 |
| 47 DISALLOW_COPY_AND_ASSIGN(PackExtensionJob); | 50 DISALLOW_COPY_AND_ASSIGN(PackExtensionJob); |
| 48 }; | 51 }; |
| 52 |
| 53 #endif // CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_UI_H_ |
| 54 |
| OLD | NEW |