| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 BrowserThread::PostTask( | 294 BrowserThread::PostTask( |
| 295 BrowserThread::UI, | 295 BrowserThread::UI, |
| 296 FROM_HERE, | 296 FROM_HERE, |
| 297 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this)); | 297 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this)); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { | 300 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { |
| 301 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 301 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 302 if (!on_failure_callback_.is_null()) | |
| 303 on_failure_callback_.Run(extension_path_, error); | |
| 304 | 302 |
| 305 if (service_weak_.get()) { | 303 if (service_weak_.get()) { |
| 306 ExtensionErrorReporter::GetInstance()->ReportLoadError( | 304 ExtensionErrorReporter::GetInstance()->ReportLoadError( |
| 307 extension_path_, | 305 extension_path_, |
| 308 error, | 306 error, |
| 309 service_weak_->profile(), | 307 service_weak_->profile(), |
| 310 be_noisy_on_failure_); | 308 be_noisy_on_failure_); |
| 311 } | 309 } |
| 312 } | 310 } |
| 313 | 311 |
| 314 void UnpackedInstaller::InstallExtension() { | 312 void UnpackedInstaller::InstallExtension() { |
| 315 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 313 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 316 | 314 |
| 317 PermissionsUpdater perms_updater(service_weak_->profile()); | 315 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 318 perms_updater.GrantActivePermissions(extension()); | 316 perms_updater.GrantActivePermissions(extension()); |
| 319 | 317 |
| 320 service_weak_->OnExtensionInstalled( | 318 service_weak_->OnExtensionInstalled( |
| 321 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); | 319 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); |
| 322 } | 320 } |
| 323 | 321 |
| 324 } // namespace extensions | 322 } // namespace extensions |
| OLD | NEW |