diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 02:15:20 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 02:15:20 +0000 |
commit | 6657afa65426f10f5dc51c0ac12d573c4826cb54 (patch) | |
tree | 3b24f83dd2f834bde93b7b7e27327701814379ac /chrome/browser/extensions/convert_user_script.h | |
parent | 6c856ae733bf8d1f187ec5b93e07216ace0c4693 (diff) | |
download | chromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.zip chromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.tar.gz chromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.tar.bz2 |
Add first class support for user scripts.
Original review: http://codereview.chromium.org/340057
TBR=mpcomplete@chromium.org
BUG=22103
TEST=Install a user script (such as from userscripts.org). You should get the extension install UI and the
script should show up in the extension management UI. It should also work, though some scripts use
Firefox-specific APIs and those won't work in Chromium.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/convert_user_script.h')
-rw-r--r-- | chrome/browser/extensions/convert_user_script.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/extensions/convert_user_script.h b/chrome/browser/extensions/convert_user_script.h new file mode 100644 index 0000000..ebc9ee2 --- /dev/null +++ b/chrome/browser/extensions/convert_user_script.h @@ -0,0 +1,23 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ +#define CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ + +#include <string> + +class Extension; +class FilePath; +class GURL; + +// Wraps the specified user script in an extension. The extension is created +// unpacked in the system temp dir. Returns a valid extension that the caller +// should take ownership on success, or NULL and |error| on failure. +// +// NOTE: This function does file IO and should not be called on the UI thread. +Extension* ConvertUserScriptToExtension(const FilePath& user_script, + const GURL& original_url, + std::string* error); + +#endif // CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_ |