| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/unpacked_installer.h" | 5 #include "chrome/browser/extensions/unpacked_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 int flags = Extension::REQUIRE_MODERN_MANIFEST_VERSION; | 125 int flags = Extension::REQUIRE_MODERN_MANIFEST_VERSION; |
| 126 if (allow_file_access) | 126 if (allow_file_access) |
| 127 flags |= Extension::ALLOW_FILE_ACCESS; | 127 flags |= Extension::ALLOW_FILE_ACCESS; |
| 128 if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD)) | 128 if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD)) |
| 129 flags |= Extension::STRICT_ERROR_CHECKS; | 129 flags |= Extension::STRICT_ERROR_CHECKS; |
| 130 | 130 |
| 131 std::string error; | 131 std::string error; |
| 132 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 132 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
| 133 extension_path_, | 133 extension_path_, |
| 134 Extension::LOAD, | 134 Extension::LOAD, |
| 135 flags, | 135 flags | Extension::FOLLOW_SYMLINKS_ANYWHERE, |
| 136 &error)); | 136 &error)); |
| 137 | 137 |
| 138 if (!extension) { | 138 if (!extension) { |
| 139 ReportExtensionLoadError(error); | 139 ReportExtensionLoadError(error); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 | 142 |
| 143 OnLoaded(extension); | 143 OnLoaded(extension); |
| 144 } | 144 } |
| 145 | 145 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 188 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 189 int flags = Extension::REQUIRE_MODERN_MANIFEST_VERSION; | 189 int flags = Extension::REQUIRE_MODERN_MANIFEST_VERSION; |
| 190 if (allow_file_access) | 190 if (allow_file_access) |
| 191 flags |= Extension::ALLOW_FILE_ACCESS; | 191 flags |= Extension::ALLOW_FILE_ACCESS; |
| 192 if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD)) | 192 if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD)) |
| 193 flags |= Extension::STRICT_ERROR_CHECKS; | 193 flags |= Extension::STRICT_ERROR_CHECKS; |
| 194 std::string error; | 194 std::string error; |
| 195 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 195 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
| 196 extension_path_, | 196 extension_path_, |
| 197 Extension::LOAD, | 197 Extension::LOAD, |
| 198 flags, | 198 flags | Extension::FOLLOW_SYMLINKS_ANYWHERE, |
| 199 &error)); | 199 &error)); |
| 200 | 200 |
| 201 if (!extension) { | 201 if (!extension) { |
| 202 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 202 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 203 base::Bind( | 203 base::Bind( |
| 204 &UnpackedInstaller::ReportExtensionLoadError, | 204 &UnpackedInstaller::ReportExtensionLoadError, |
| 205 this, error)); | 205 this, error)); |
| 206 return; | 206 return; |
| 207 } | 207 } |
| 208 | 208 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 PermissionsUpdater perms_updater(service_weak_->profile()); | 241 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 242 perms_updater.GrantActivePermissions(extension); | 242 perms_updater.GrantActivePermissions(extension); |
| 243 service_weak_->OnExtensionInstalled(extension, | 243 service_weak_->OnExtensionInstalled(extension, |
| 244 false, // Not from web store. | 244 false, // Not from web store. |
| 245 StringOrdinal()); | 245 StringOrdinal()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace extensions | 248 } // namespace extensions |
| OLD | NEW |