| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/install_verifier.h" | 5 #include "chrome/browser/extensions/install_verifier.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 InstallVerifier::PendingOperation::~PendingOperation() { | 439 InstallVerifier::PendingOperation::~PendingOperation() { |
| 440 } | 440 } |
| 441 | 441 |
| 442 ExtensionIdSet InstallVerifier::GetExtensionsToVerify() const { | 442 ExtensionIdSet InstallVerifier::GetExtensionsToVerify() const { |
| 443 ExtensionIdSet result; | 443 ExtensionIdSet result; |
| 444 scoped_ptr<ExtensionSet> extensions = | 444 scoped_ptr<ExtensionSet> extensions = |
| 445 ExtensionRegistry::Get(context_)->GenerateInstalledExtensionsSet(); | 445 ExtensionRegistry::Get(context_)->GenerateInstalledExtensionsSet(); |
| 446 for (ExtensionSet::const_iterator iter = extensions->begin(); | 446 for (ExtensionSet::const_iterator iter = extensions->begin(); |
| 447 iter != extensions->end(); | 447 iter != extensions->end(); |
| 448 ++iter) { | 448 ++iter) { |
| 449 if (NeedsVerification(**iter)) | 449 if (NeedsVerification(*iter->get())) |
| 450 result.insert((*iter)->id()); | 450 result.insert((*iter)->id()); |
| 451 } | 451 } |
| 452 return result; | 452 return result; |
| 453 } | 453 } |
| 454 | 454 |
| 455 void InstallVerifier::MaybeBootstrapSelf() { | 455 void InstallVerifier::MaybeBootstrapSelf() { |
| 456 bool needs_bootstrap = false; | 456 bool needs_bootstrap = false; |
| 457 | 457 |
| 458 ExtensionIdSet extension_ids = GetExtensionsToVerify(); | 458 ExtensionIdSet extension_ids = GetExtensionsToVerify(); |
| 459 if (signature_.get() == NULL && ShouldFetchSignature()) { | 459 if (signature_.get() == NULL && ShouldFetchSignature()) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 487 if (success) { | 487 if (success) { |
| 488 // Iterate through the extensions and, if any are newly-verified and | 488 // Iterate through the extensions and, if any are newly-verified and |
| 489 // should have the DISABLE_NOT_VERIFIED reason lifted, do so. | 489 // should have the DISABLE_NOT_VERIFIED reason lifted, do so. |
| 490 const ExtensionSet& disabled_extensions = | 490 const ExtensionSet& disabled_extensions = |
| 491 ExtensionRegistry::Get(context_)->disabled_extensions(); | 491 ExtensionRegistry::Get(context_)->disabled_extensions(); |
| 492 for (ExtensionSet::const_iterator iter = disabled_extensions.begin(); | 492 for (ExtensionSet::const_iterator iter = disabled_extensions.begin(); |
| 493 iter != disabled_extensions.end(); | 493 iter != disabled_extensions.end(); |
| 494 ++iter) { | 494 ++iter) { |
| 495 int disable_reasons = prefs_->GetDisableReasons((*iter)->id()); | 495 int disable_reasons = prefs_->GetDisableReasons((*iter)->id()); |
| 496 if (disable_reasons & Extension::DISABLE_NOT_VERIFIED && | 496 if (disable_reasons & Extension::DISABLE_NOT_VERIFIED && |
| 497 !MustRemainDisabled(*iter, NULL, NULL)) { | 497 !MustRemainDisabled(iter->get(), NULL, NULL)) { |
| 498 prefs_->RemoveDisableReason((*iter)->id(), | 498 prefs_->RemoveDisableReason((*iter)->id(), |
| 499 Extension::DISABLE_NOT_VERIFIED); | 499 Extension::DISABLE_NOT_VERIFIED); |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 if (success || GetStatus() == ENFORCE_STRICT) { | 503 if (success || GetStatus() == ENFORCE_STRICT) { |
| 504 ExtensionSystem::Get(context_) | 504 ExtensionSystem::Get(context_) |
| 505 ->extension_service() | 505 ->extension_service() |
| 506 ->CheckManagementPolicy(); | 506 ->CheckManagementPolicy(); |
| 507 } | 507 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 642 } |
| 643 | 643 |
| 644 OnVerificationComplete(success, operation->type); | 644 OnVerificationComplete(success, operation->type); |
| 645 } | 645 } |
| 646 | 646 |
| 647 if (!operation_queue_.empty()) | 647 if (!operation_queue_.empty()) |
| 648 BeginFetch(); | 648 BeginFetch(); |
| 649 } | 649 } |
| 650 | 650 |
| 651 } // namespace extensions | 651 } // namespace extensions |
| OLD | NEW |