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_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 static const char* kExtensionRegistryPath; | 135 static const char* kExtensionRegistryPath; |
136 #endif | 136 #endif |
137 | 137 |
138 // The number of bytes in a legal id. | 138 // The number of bytes in a legal id. |
139 static const size_t kIdSize; | 139 static const size_t kIdSize; |
140 | 140 |
141 Extension() : location_(INVALID), is_theme_(false) {} | 141 Extension() : location_(INVALID), is_theme_(false) {} |
142 explicit Extension(const FilePath& path); | 142 explicit Extension(const FilePath& path); |
143 virtual ~Extension(); | 143 virtual ~Extension(); |
144 | 144 |
| 145 // Returns true if the specified file is an extension. |
| 146 static bool IsExtension(const FilePath& file_name); |
| 147 |
145 // Resets the id counter. This is only useful for unit tests. | 148 // Resets the id counter. This is only useful for unit tests. |
146 static void ResetGeneratedIdCounter() { | 149 static void ResetGeneratedIdCounter() { |
147 id_counter_ = 0; | 150 id_counter_ = 0; |
148 } | 151 } |
149 | 152 |
150 // Checks to see if the extension has a valid ID. | 153 // Checks to see if the extension has a valid ID. |
151 static bool IdIsValid(const std::string& id); | 154 static bool IdIsValid(const std::string& id); |
152 | 155 |
153 // Whether the |location| is external or not. | 156 // Whether the |location| is external or not. |
154 static inline bool IsExternalLocation(Location location) { | 157 static inline bool IsExternalLocation(Location location) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // The sites this extension has permission to talk to (using XHR, etc). | 335 // The sites this extension has permission to talk to (using XHR, etc). |
333 std::vector<URLPattern> permissions_; | 336 std::vector<URLPattern> permissions_; |
334 | 337 |
335 // URL for fetching an update manifest | 338 // URL for fetching an update manifest |
336 GURL update_url_; | 339 GURL update_url_; |
337 | 340 |
338 DISALLOW_COPY_AND_ASSIGN(Extension); | 341 DISALLOW_COPY_AND_ASSIGN(Extension); |
339 }; | 342 }; |
340 | 343 |
341 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 344 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |