[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame^] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ | ||||
6 | #define CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 8 | |
9 | #include <string> | ||||
10 | |||||
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame^] | 11 | #include "base/memory/ref_counted.h" |
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 12 | |
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 13 | class Extension; |
14 | class FilePath; | ||||
15 | class GURL; | ||||
16 | |||||
17 | // Wraps the specified user script in an extension. The extension is created | ||||
18 | // unpacked in the system temp dir. Returns a valid extension that the caller | ||||
19 | // should take ownership on success, or NULL and |error| on failure. | ||||
20 | // | ||||
21 | // NOTE: This function does file IO and should not be called on the UI thread. | ||||
[email protected] | 5ba5dab | 2010-11-18 02:31:04 | [diff] [blame] | 22 | // NOTE: The caller takes ownership of the directory at extension->path() on the |
23 | // returned object. | ||||
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 24 | scoped_refptr<Extension> ConvertUserScriptToExtension( |
25 | const FilePath& user_script, const GURL& original_url, std::string* error); | ||||
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 26 | |
27 | #endif // CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ |