OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 // The mimetype used for extensions. | 184 // The mimetype used for extensions. |
185 static const char kMimeType[]; | 185 static const char kMimeType[]; |
186 | 186 |
187 // Checks to see if the extension has a valid ID. | 187 // Checks to see if the extension has a valid ID. |
188 static bool IdIsValid(const std::string& id); | 188 static bool IdIsValid(const std::string& id); |
189 | 189 |
190 // Returns true if the specified file is an extension. | 190 // Returns true if the specified file is an extension. |
191 static bool IsExtension(const base::FilePath& file_name); | 191 static bool IsExtension(const base::FilePath& file_name); |
192 | 192 |
193 // Fills the |info| dictionary with basic information about the extension. | |
194 // |enabled| is injected for easier testing. | |
195 void GetBasicInfo(bool enabled, base::DictionaryValue* info) const; | |
196 | |
197 // See Type definition in Manifest. | 193 // See Type definition in Manifest. |
198 Manifest::Type GetType() const; | 194 Manifest::Type GetType() const; |
199 | 195 |
200 // Returns an absolute url to a resource inside of an extension. The | 196 // Returns an absolute url to a resource inside of an extension. The |
201 // |extension_url| argument should be the url() from an Extension object. The | 197 // |extension_url| argument should be the url() from an Extension object. The |
202 // |relative_path| can be untrusted user input. The returned URL will either | 198 // |relative_path| can be untrusted user input. The returned URL will either |
203 // be invalid() or a child of |extension_url|. | 199 // be invalid() or a child of |extension_url|. |
204 // NOTE: Static so that it can be used from multiple threads. | 200 // NOTE: Static so that it can be used from multiple threads. |
205 static GURL GetResourceURL(const GURL& extension_url, | 201 static GURL GetResourceURL(const GURL& extension_url, |
206 const std::string& relative_path); | 202 const std::string& relative_path); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 574 |
579 UpdatedExtensionPermissionsInfo( | 575 UpdatedExtensionPermissionsInfo( |
580 const Extension* extension, | 576 const Extension* extension, |
581 const PermissionSet* permissions, | 577 const PermissionSet* permissions, |
582 Reason reason); | 578 Reason reason); |
583 }; | 579 }; |
584 | 580 |
585 } // namespace extensions | 581 } // namespace extensions |
586 | 582 |
587 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 583 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |