Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / extensions / convert_user_script.h
blob1a910a00528d14a7075da323c624f1334ed48f50
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_
6 #define CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "base/strings/string16.h"
13 class GURL;
15 namespace base {
16 class FilePath;
19 namespace extensions {
20 class Extension;
22 // Wraps the specified user script in an extension. The extension is created
23 // unpacked in the system temp dir. Returns a valid extension that the caller
24 // should take ownership on success, or NULL and |error| on failure.
26 // NOTE: This function does file IO and should not be called on the UI thread.
27 // NOTE: The caller takes ownership of the directory at extension->path() on the
28 // returned object.
29 scoped_refptr<extensions::Extension> ConvertUserScriptToExtension(
30 const base::FilePath& user_script, const GURL& original_url,
31 const base::FilePath& extensions_dir, base::string16* error);
33 } // namespace extensions
35 #endif // CHROME_BROWSER_EXTENSIONS_CONVERT_USER_SCRIPT_H_