| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/convert_user_script.h" | 5 #include "chrome/browser/extensions/convert_user_script.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (!file_util::CopyFile(user_script_path, | 143 if (!file_util::CopyFile(user_script_path, |
| 144 temp_dir.path().AppendASCII("script.js"))) { | 144 temp_dir.path().AppendASCII("script.js"))) { |
| 145 *error = "Could not copy script file."; | 145 *error = "Could not copy script file."; |
| 146 return NULL; | 146 return NULL; |
| 147 } | 147 } |
| 148 | 148 |
| 149 scoped_refptr<Extension> extension = Extension::Create( | 149 scoped_refptr<Extension> extension = Extension::Create( |
| 150 temp_dir.path(), | 150 temp_dir.path(), |
| 151 Extension::INTERNAL, | 151 Extension::INTERNAL, |
| 152 *root, | 152 *root, |
| 153 false, // Do not require key | 153 Extension::NO_FLAGS, |
| 154 false, // Disable strict checks | |
| 155 error); | 154 error); |
| 156 if (!extension) { | 155 if (!extension) { |
| 157 NOTREACHED() << "Could not init extension " << *error; | 156 NOTREACHED() << "Could not init extension " << *error; |
| 158 return NULL; | 157 return NULL; |
| 159 } | 158 } |
| 160 | 159 |
| 161 temp_dir.Take(); // The caller takes ownership of the directory. | 160 temp_dir.Take(); // The caller takes ownership of the directory. |
| 162 return extension; | 161 return extension; |
| 163 } | 162 } |
| OLD | NEW |