| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 BrowserThread::UI, FROM_HERE, | 388 BrowserThread::UI, FROM_HERE, |
| 389 base::Bind(&CrxInstaller::ConfirmInstall, this))) | 389 base::Bind(&CrxInstaller::ConfirmInstall, this))) |
| 390 NOTREACHED(); | 390 NOTREACHED(); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void CrxInstaller::ConfirmInstall() { | 393 void CrxInstaller::ConfirmInstall() { |
| 394 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 394 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 395 if (!frontend_weak_.get()) | 395 if (!frontend_weak_.get()) |
| 396 return; | 396 return; |
| 397 | 397 |
| 398 if (frontend_weak_->extension_prefs() | |
| 399 ->IsExtensionBlacklisted(extension_->id())) { | |
| 400 VLOG(1) << "This extension: " << extension_->id() | |
| 401 << " is blacklisted. Install failed."; | |
| 402 ReportFailureFromUIThread( | |
| 403 CrxInstallerError( | |
| 404 l10n_util::GetStringUTF16(IDS_EXTENSION_CANT_INSTALL_BLACKLISTED))); | |
| 405 return; | |
| 406 } | |
| 407 | |
| 408 string16 error; | 398 string16 error; |
| 409 if (!ExtensionSystem::Get(profile_)->management_policy()-> | 399 if (!ExtensionSystem::Get(profile_)->management_policy()-> |
| 410 UserMayLoad(extension_, &error)) { | 400 UserMayLoad(extension_, &error)) { |
| 411 ReportFailureFromUIThread(CrxInstallerError(error)); | 401 ReportFailureFromUIThread(CrxInstallerError(error)); |
| 412 return; | 402 return; |
| 413 } | 403 } |
| 414 | 404 |
| 415 GURL overlapping_url; | 405 GURL overlapping_url; |
| 416 const Extension* overlapping_extension = | 406 const Extension* overlapping_extension = |
| 417 frontend_weak_->extensions()-> | 407 frontend_weak_->extensions()-> |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 // is problematic because they don't know anything about the | 609 // is problematic because they don't know anything about the |
| 620 // extension before it is unpacked, so they cannot filter based | 610 // extension before it is unpacked, so they cannot filter based |
| 621 // on the extension. | 611 // on the extension. |
| 622 content::NotificationService::current()->Notify( | 612 content::NotificationService::current()->Notify( |
| 623 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 613 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 624 content::Source<CrxInstaller>(this), | 614 content::Source<CrxInstaller>(this), |
| 625 content::Details<const Extension>(extension)); | 615 content::Details<const Extension>(extension)); |
| 626 } | 616 } |
| 627 | 617 |
| 628 } // namespace extensions | 618 } // namespace extensions |
| OLD | NEW |