Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 292223003: Count blacklisting as an extension being disabled. Correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698