| 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 |
| 11 #include "base/file_path.h" |
| 11 #include "base/string16.h" | 12 #include "base/string16.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 | 14 |
| 14 // Represents a Chromium extension. | 15 // Represents a Chromium extension. |
| 15 class Extension { | 16 class Extension { |
| 16 public: | 17 public: |
| 17 Extension(){}; | 18 Extension(){}; |
| 18 | 19 |
| 19 // The format for extension manifests that this code understands. | 20 // The format for extension manifests that this code understands. |
| 20 static const int kExpectedFormatVersion = 1; | 21 static const int kExpectedFormatVersion = 1; |
| 21 | 22 |
| 23 // The name of the manifest inside an extension. |
| 24 static const FilePath::CharType* kManifestFilename; |
| 25 |
| 22 // Keys used in JSON representation of extensions. | 26 // Keys used in JSON representation of extensions. |
| 23 static const std::wstring kFormatVersionKey; | 27 static const wchar_t* kFormatVersionKey; |
| 24 static const std::wstring kIdKey; | 28 static const wchar_t* kIdKey; |
| 25 static const std::wstring kNameKey; | 29 static const wchar_t* kNameKey; |
| 26 static const std::wstring kDescriptionKey; | 30 static const wchar_t* kDescriptionKey; |
| 27 static const std::wstring kContentScriptsKey; | 31 static const wchar_t* kContentScriptsKey; |
| 28 | 32 |
| 29 // Error messages returned from InitFromValue(). | 33 // Error messages returned from InitFromValue(). |
| 30 static const std::wstring kInvalidFormatVersionError; | 34 static const wchar_t* kInvalidFormatVersionError; |
| 31 static const std::wstring kInvalidIdError; | 35 static const wchar_t* kInvalidManifestError; |
| 32 static const std::wstring kInvalidNameError; | 36 static const wchar_t* kInvalidIdError; |
| 33 static const std::wstring kInvalidDescriptionError; | 37 static const wchar_t* kInvalidNameError; |
| 34 static const std::wstring kInvalidContentScriptsListError; | 38 static const wchar_t* kInvalidDescriptionError; |
| 35 static const std::wstring kInvalidContentScriptError; | 39 static const wchar_t* kInvalidContentScriptsListError; |
| 40 static const wchar_t* kInvalidContentScriptError; |
| 36 | 41 |
| 37 // A human-readable ID for the extension. The convention is to use something | 42 // A human-readable ID for the extension. The convention is to use something |
| 38 // like 'com.example.myextension', but this is not currently enforced. An | 43 // like 'com.example.myextension', but this is not currently enforced. An |
| 39 // extension's ID is used in things like directory structures and URLs, and | 44 // extension's ID is used in things like directory structures and URLs, and |
| 40 // is expected to not change across versions. In the case of conflicts, | 45 // is expected to not change across versions. In the case of conflicts, |
| 41 // updates will only be allowed if the extension can be validated using the | 46 // updates will only be allowed if the extension can be validated using the |
| 42 // previous version's update key. | 47 // previous version's update key. |
| 43 const std::wstring& id() const { return id_; } | 48 const std::wstring& id() const { return id_; } |
| 44 | 49 |
| 45 // A human-readable name of the extension. | 50 // A human-readable name of the extension. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 | 66 |
| 62 private: | 67 private: |
| 63 std::wstring id_; | 68 std::wstring id_; |
| 64 std::wstring name_; | 69 std::wstring name_; |
| 65 std::wstring description_; | 70 std::wstring description_; |
| 66 std::vector<std::wstring> content_scripts_; | 71 std::vector<std::wstring> content_scripts_; |
| 67 | 72 |
| 68 DISALLOW_COPY_AND_ASSIGN(Extension); | 73 DISALLOW_COPY_AND_ASSIGN(Extension); |
| 69 }; | 74 }; |
| 70 | 75 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_H__ | 76 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |