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

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

Issue 2147923002: [Extensions] Fixed removing from blacklist. (Closed) Base URL: ssh://bitbucket.browser.yandex-team.ru/chromium/src.git@master
Patch Set: Unnecessary extensions:: namespace is removed. Created 4 years, 5 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 2340 matching lines...) Expand 10 before | Expand all | Expand 10 after
2351 for (ExtensionIdSet::iterator it = no_longer_blocked.begin(); 2351 for (ExtensionIdSet::iterator it = no_longer_blocked.begin();
2352 it != no_longer_blocked.end(); ++it) { 2352 it != no_longer_blocked.end(); ++it) {
2353 scoped_refptr<const Extension> extension = 2353 scoped_refptr<const Extension> extension =
2354 registry_->blacklisted_extensions().GetByID(*it); 2354 registry_->blacklisted_extensions().GetByID(*it);
2355 if (!extension.get()) { 2355 if (!extension.get()) {
2356 NOTREACHED() << "Extension " << *it << " no longer blacklisted, " 2356 NOTREACHED() << "Extension " << *it << " no longer blacklisted, "
2357 << "but it was never blacklisted."; 2357 << "but it was never blacklisted.";
2358 continue; 2358 continue;
2359 } 2359 }
2360 registry_->RemoveBlacklisted(*it); 2360 registry_->RemoveBlacklisted(*it);
2361 extension_prefs_->SetExtensionBlacklisted(extension->id(), false); 2361 extension_prefs_->SetExtensionBlacklistState(extension->id(),
2362 extensions::NOT_BLACKLISTED);
2362 AddExtension(extension.get()); 2363 AddExtension(extension.get());
2363 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled", 2364 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled",
2364 extension->location(), 2365 extension->location(),
2365 Manifest::NUM_LOCATIONS); 2366 Manifest::NUM_LOCATIONS);
2366 } 2367 }
2367 2368
2368 for (ExtensionIdSet::iterator it = not_yet_blocked.begin(); 2369 for (ExtensionIdSet::iterator it = not_yet_blocked.begin();
2369 it != not_yet_blocked.end(); ++it) { 2370 it != not_yet_blocked.end(); ++it) {
2370 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); 2371 scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
2371 if (!extension.get()) { 2372 if (!extension.get()) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 } 2467 }
2467 2468
2468 void ExtensionService::OnProfileDestructionStarted() { 2469 void ExtensionService::OnProfileDestructionStarted() {
2469 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2470 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2470 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2471 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2471 it != ids_to_unload.end(); 2472 it != ids_to_unload.end();
2472 ++it) { 2473 ++it) {
2473 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2474 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2474 } 2475 }
2475 } 2476 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698