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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 516 } |
517 | 517 |
518 void CrxInstaller::OnBlacklistChecked( | 518 void CrxInstaller::OnBlacklistChecked( |
519 extensions::Blacklist::BlacklistState blacklist_state) { | 519 extensions::Blacklist::BlacklistState blacklist_state) { |
520 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 520 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
521 if (!service_weak_) | 521 if (!service_weak_) |
522 return; | 522 return; |
523 | 523 |
524 blacklist_state_ = blacklist_state; | 524 blacklist_state_ = blacklist_state; |
525 | 525 |
526 if (blacklist_state_ == extensions::Blacklist::BLACKLISTED_MALWARE && | 526 if ((blacklist_state_ == extensions::Blacklist::BLACKLISTED_MALWARE || |
| 527 blacklist_state_ == extensions::Blacklist::BLACKLISTED_UNKNOWN) && |
527 !allow_silent_install_) { | 528 !allow_silent_install_) { |
528 // User tried to install a blacklisted extension. Show an error and | 529 // User tried to install a blacklisted extension. Show an error and |
529 // refuse to install it. | 530 // refuse to install it. |
530 ReportFailureFromUIThread(extensions::CrxInstallerError( | 531 ReportFailureFromUIThread(extensions::CrxInstallerError( |
531 l10n_util::GetStringFUTF16(IDS_EXTENSION_IS_BLACKLISTED, | 532 l10n_util::GetStringFUTF16(IDS_EXTENSION_IS_BLACKLISTED, |
532 UTF8ToUTF16(extension()->name())))); | 533 UTF8ToUTF16(extension()->name())))); |
533 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlockCRX", | 534 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlockCRX", |
534 extension()->location(), | 535 extension()->location(), |
535 Manifest::NUM_LOCATIONS); | 536 Manifest::NUM_LOCATIONS); |
536 return; | 537 return; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 863 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
863 return; | 864 return; |
864 | 865 |
865 if (client_) { | 866 if (client_) { |
866 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 867 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
867 client_->ConfirmReEnable(this, extension()); | 868 client_->ConfirmReEnable(this, extension()); |
868 } | 869 } |
869 } | 870 } |
870 | 871 |
871 } // namespace extensions | 872 } // namespace extensions |
OLD | NEW |