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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 773 } |
774 | 774 |
775 if (registry_->disabled_extensions().Contains(extension_id) || | 775 if (registry_->disabled_extensions().Contains(extension_id) || |
776 registry_->blacklisted_extensions().Contains(extension_id)) { | 776 registry_->blacklisted_extensions().Contains(extension_id)) { |
777 return false; | 777 return false; |
778 } | 778 } |
779 | 779 |
780 // If the extension hasn't been loaded yet, check the prefs for it. Assume | 780 // If the extension hasn't been loaded yet, check the prefs for it. Assume |
781 // enabled unless otherwise noted. | 781 // enabled unless otherwise noted. |
782 return !extension_prefs_->IsExtensionDisabled(extension_id) && | 782 return !extension_prefs_->IsExtensionDisabled(extension_id) && |
| 783 !extension_prefs_->IsExtensionBlacklisted(extension_id) && |
783 !extension_prefs_->IsExternalExtensionUninstalled(extension_id); | 784 !extension_prefs_->IsExternalExtensionUninstalled(extension_id); |
784 } | 785 } |
785 | 786 |
786 void ExtensionService::EnableExtension(const std::string& extension_id) { | 787 void ExtensionService::EnableExtension(const std::string& extension_id) { |
787 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 788 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
788 | 789 |
789 if (IsExtensionEnabled(extension_id)) | 790 if (IsExtensionEnabled(extension_id)) |
790 return; | 791 return; |
791 const Extension* extension = | 792 const Extension* extension = |
792 registry_->disabled_extensions().GetByID(extension_id); | 793 registry_->disabled_extensions().GetByID(extension_id); |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2450 } | 2451 } |
2451 | 2452 |
2452 void ExtensionService::OnProfileDestructionStarted() { | 2453 void ExtensionService::OnProfileDestructionStarted() { |
2453 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2454 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2454 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2455 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2455 it != ids_to_unload.end(); | 2456 it != ids_to_unload.end(); |
2456 ++it) { | 2457 ++it) { |
2457 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2458 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2458 } | 2459 } |
2459 } | 2460 } |
OLD | NEW |