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_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const std::string& id, | 51 const std::string& id, |
52 const SkBitmap& icon, | 52 const SkBitmap& icon, |
53 base::DictionaryValue* parsed_manifest) = 0; | 53 base::DictionaryValue* parsed_manifest) = 0; |
54 | 54 |
55 // Called to indicate a parse failure. The |result_code| parameter should | 55 // Called to indicate a parse failure. The |result_code| parameter should |
56 // indicate whether the problem was with the manifest or icon. | 56 // indicate whether the problem was with the manifest or icon. |
57 virtual void OnWebstoreParseFailure( | 57 virtual void OnWebstoreParseFailure( |
58 const std::string& id, | 58 const std::string& id, |
59 InstallHelperResultCode result_code, | 59 InstallHelperResultCode result_code, |
60 const std::string& error_message) = 0; | 60 const std::string& error_message) = 0; |
| 61 |
| 62 protected: |
| 63 virtual ~Delegate() {} |
61 }; | 64 }; |
62 | 65 |
63 // Only one of |icon_data| (based64-encoded icon data) or |icon_url| can be | 66 // Only one of |icon_data| (based64-encoded icon data) or |icon_url| can be |
64 // specified, but it is legal for both to be empty. | 67 // specified, but it is legal for both to be empty. |
65 WebstoreInstallHelper(Delegate* delegate, | 68 WebstoreInstallHelper(Delegate* delegate, |
66 const std::string& id, | 69 const std::string& id, |
67 const std::string& manifest, | 70 const std::string& manifest, |
68 const std::string& icon_data, | 71 const std::string& icon_data, |
69 const GURL& icon_url, | 72 const GURL& icon_url, |
70 net::URLRequestContextGetter* context_getter); | 73 net::URLRequestContextGetter* context_getter); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 126 |
124 // A details string for keeping track of any errors. | 127 // A details string for keeping track of any errors. |
125 std::string error_; | 128 std::string error_; |
126 | 129 |
127 // A code to distinguish between an error with the icon, and an error with the | 130 // A code to distinguish between an error with the icon, and an error with the |
128 // manifest. | 131 // manifest. |
129 Delegate::InstallHelperResultCode parse_error_; | 132 Delegate::InstallHelperResultCode parse_error_; |
130 }; | 133 }; |
131 | 134 |
132 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_HELPER_H_ |
OLD | NEW |