| 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_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // get results back. All functions are called on the thread passed along | 28 // get results back. All functions are called on the thread passed along |
| 29 // to UtilityProcessHost. | 29 // to UtilityProcessHost. |
| 30 class Client : public base::RefCountedThreadSafe<Client> { | 30 class Client : public base::RefCountedThreadSafe<Client> { |
| 31 public: | 31 public: |
| 32 Client() {} | 32 Client() {} |
| 33 | 33 |
| 34 // Called when the process has crashed. | 34 // Called when the process has crashed. |
| 35 virtual void OnProcessCrashed() {} | 35 virtual void OnProcessCrashed() {} |
| 36 | 36 |
| 37 // Called when the extension has unpacked successfully. |manifest| is the | 37 // Called when the extension has unpacked successfully. |manifest| is the |
| 38 // parsed manifest.json file. |images| contains a list of decoded images | 38 // parsed manifest.json file. |catalogs| contains list of all parsed |
| 39 // and the associated paths where those images live on disk. | 39 // message catalogs. |images| contains a list of decoded images and the |
| 40 virtual void OnUnpackExtensionSucceeded(const DictionaryValue& manifest) {} | 40 // associated paths where those images live on disk. |
| 41 virtual void OnUnpackExtensionSucceeded(const DictionaryValue& manifest, |
| 42 const DictionaryValue& catalogs) {} |
| 41 | 43 |
| 42 // Called when an error occurred while unpacking the extension. | 44 // Called when an error occurred while unpacking the extension. |
| 43 // |error_message| contains a description of the problem. | 45 // |error_message| contains a description of the problem. |
| 44 virtual void OnUnpackExtensionFailed(const std::string& error_message) {} | 46 virtual void OnUnpackExtensionFailed(const std::string& error_message) {} |
| 45 | 47 |
| 46 // Called when the web resource has been successfully parsed. |json_data| | 48 // Called when the web resource has been successfully parsed. |json_data| |
| 47 // contains the parsed list of web resource items downloaded from the | 49 // contains the parsed list of web resource items downloaded from the |
| 48 // web resource server. | 50 // web resource server. |
| 49 virtual void OnUnpackWebResourceSucceeded( | 51 virtual void OnUnpackWebResourceSucceeded( |
| 50 const DictionaryValue& json_data) {} | 52 const DictionaryValue& json_data) {} |
| 51 | 53 |
| 52 // Called when an error occurred while parsing the resource data. | 54 // Called when an error occurred while parsing the resource data. |
| 53 // |error_message| contains a description of the problem. | 55 // |error_message| contains a description of the problem. |
| 54 virtual void OnUnpackWebResourceFailed( | 56 virtual void OnUnpackWebResourceFailed(const std::string& error_message) {} |
| 55 const std::string& error_message) {} | |
| 56 | 57 |
| 57 // Called when an update manifest xml file was successfully parsed. | 58 // Called when an update manifest xml file was successfully parsed. |
| 58 virtual void OnParseUpdateManifestSucceeded( | 59 virtual void OnParseUpdateManifestSucceeded( |
| 59 const UpdateManifest::ResultList& list) {} | 60 const UpdateManifest::ResultList& list) {} |
| 60 | 61 |
| 61 // Called when an update manifest xml file failed parsing. |error_message| | 62 // Called when an update manifest xml file failed parsing. |error_message| |
| 62 // contains details suitable for logging. | 63 // contains details suitable for logging. |
| 63 virtual void OnParseUpdateManifestFailed( | 64 virtual void OnParseUpdateManifestFailed( |
| 64 const std::string& error_message) {} | 65 const std::string& error_message) {} |
| 65 | 66 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 122 } |
| 122 | 123 |
| 123 // A pointer to our client interface, who will be informed of progress. | 124 // A pointer to our client interface, who will be informed of progress. |
| 124 scoped_refptr<Client> client_; | 125 scoped_refptr<Client> client_; |
| 125 ChromeThread::ID client_thread_id_; | 126 ChromeThread::ID client_thread_id_; |
| 126 | 127 |
| 127 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost); | 128 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost); |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 #endif // CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ | 131 #endif // CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |