| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_EXTENSION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 static const char kManifestFilename[]; | 37 static const char kManifestFilename[]; |
| 38 | 38 |
| 39 // Keys used in JSON representation of extensions. | 39 // Keys used in JSON representation of extensions. |
| 40 static const wchar_t* kDescriptionKey; | 40 static const wchar_t* kDescriptionKey; |
| 41 static const wchar_t* kFilesKey; | 41 static const wchar_t* kFilesKey; |
| 42 static const wchar_t* kFormatVersionKey; | 42 static const wchar_t* kFormatVersionKey; |
| 43 static const wchar_t* kIdKey; | 43 static const wchar_t* kIdKey; |
| 44 static const wchar_t* kMatchesKey; | 44 static const wchar_t* kMatchesKey; |
| 45 static const wchar_t* kNameKey; | 45 static const wchar_t* kNameKey; |
| 46 static const wchar_t* kUserScriptsKey; | 46 static const wchar_t* kUserScriptsKey; |
| 47 static const wchar_t* kRunAtKey; |
| 47 static const wchar_t* kVersionKey; | 48 static const wchar_t* kVersionKey; |
| 48 static const wchar_t* kZipHashKey; | 49 static const wchar_t* kZipHashKey; |
| 49 | 50 |
| 51 // Some values expected in manifests. |
| 52 static const char* kRunAtDocumentStartValue; |
| 53 static const char* kRunAtDocumentEndValue; |
| 54 |
| 50 // Error messages returned from InitFromValue(). | 55 // Error messages returned from InitFromValue(). |
| 51 static const char* kInvalidDescriptionError; | 56 static const char* kInvalidDescriptionError; |
| 52 static const char* kInvalidFileCountError; | 57 static const char* kInvalidFileCountError; |
| 53 static const char* kInvalidFileError; | 58 static const char* kInvalidFileError; |
| 54 static const char* kInvalidFilesError; | 59 static const char* kInvalidFilesError; |
| 55 static const char* kInvalidFormatVersionError; | 60 static const char* kInvalidFormatVersionError; |
| 56 static const char* kInvalidIdError; | 61 static const char* kInvalidIdError; |
| 57 static const char* kInvalidManifestError; | 62 static const char* kInvalidManifestError; |
| 58 static const char* kInvalidMatchCountError; | 63 static const char* kInvalidMatchCountError; |
| 59 static const char* kInvalidMatchError; | 64 static const char* kInvalidMatchError; |
| 60 static const char* kInvalidMatchesError; | 65 static const char* kInvalidMatchesError; |
| 61 static const char* kInvalidNameError; | 66 static const char* kInvalidNameError; |
| 67 static const char* kInvalidRunAtError; |
| 62 static const char* kInvalidUserScriptError; | 68 static const char* kInvalidUserScriptError; |
| 63 static const char* kInvalidUserScriptsListError; | 69 static const char* kInvalidUserScriptsListError; |
| 64 static const char* kInvalidVersionError; | 70 static const char* kInvalidVersionError; |
| 65 static const char* kInvalidZipHashError; | 71 static const char* kInvalidZipHashError; |
| 66 | 72 |
| 67 // Creates an absolute url to a resource inside an extension. The | 73 // Creates an absolute url to a resource inside an extension. The |
| 68 // |extension_url| argument should be the url() from an Extension object. The | 74 // |extension_url| argument should be the url() from an Extension object. The |
| 69 // |relative_path| can be untrusted user input. The returned URL will either | 75 // |relative_path| can be untrusted user input. The returned URL will either |
| 70 // be invalid() or a child of |extension_url|. | 76 // be invalid() or a child of |extension_url|. |
| 71 // NOTE: Static so that it can be used from multiple threads. | 77 // NOTE: Static so that it can be used from multiple threads. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 144 |
| 139 // A SHA1 hash of the contents of the zip file. Note that this key is only | 145 // A SHA1 hash of the contents of the zip file. Note that this key is only |
| 140 // present in the manifest that's prepended to the zip. The inner manifest | 146 // present in the manifest that's prepended to the zip. The inner manifest |
| 141 // will not have this key. | 147 // will not have this key. |
| 142 std::string zip_hash_; | 148 std::string zip_hash_; |
| 143 | 149 |
| 144 DISALLOW_COPY_AND_ASSIGN(Extension); | 150 DISALLOW_COPY_AND_ASSIGN(Extension); |
| 145 }; | 151 }; |
| 146 | 152 |
| 147 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |