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

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

Issue 671943003: Add update url controlled extension management settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-5
Patch Set: fixes addressing #3 Created 6 years, 1 month 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 <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 error_controller_->ShowErrorIfNeeded(); 1711 error_controller_->ShowErrorIfNeeded();
1712 1712
1713 // Revokes blocked permissions from active_permissions for all extensions. 1713 // Revokes blocked permissions from active_permissions for all extensions.
1714 extensions::ExtensionManagement* settings = 1714 extensions::ExtensionManagement* settings =
1715 extensions::ExtensionManagementFactory::GetForBrowserContext(profile()); 1715 extensions::ExtensionManagementFactory::GetForBrowserContext(profile());
1716 CHECK(settings); 1716 CHECK(settings);
1717 scoped_ptr<ExtensionSet> all_extensions( 1717 scoped_ptr<ExtensionSet> all_extensions(
1718 registry_->GenerateInstalledExtensionsSet()); 1718 registry_->GenerateInstalledExtensionsSet());
1719 for (const auto& extension : *all_extensions.get()) { 1719 for (const auto& extension : *all_extensions.get()) {
1720 if (!settings->IsPermissionSetAllowed( 1720 if (!settings->IsPermissionSetAllowed(
1721 extension->id(), 1721 extension.get(),
1722 extension->permissions_data()->active_permissions())) { 1722 extension->permissions_data()->active_permissions())) {
1723 extensions::PermissionsUpdater(profile()).RemovePermissions( 1723 extensions::PermissionsUpdater(profile()).RemovePermissions(
1724 extension.get(), 1724 extension.get(),
1725 settings->GetBlockedPermissions(extension->id()).get()); 1725 settings->GetBlockedPermissions(extension.get()).get());
1726 } 1726 }
1727 } 1727 }
1728 1728
1729 CheckManagementPolicy(); 1729 CheckManagementPolicy();
1730 } 1730 }
1731 1731
1732 void ExtensionService::AddNewOrUpdatedExtension( 1732 void ExtensionService::AddNewOrUpdatedExtension(
1733 const Extension* extension, 1733 const Extension* extension,
1734 Extension::State initial_state, 1734 Extension::State initial_state,
1735 int install_flags, 1735 int install_flags,
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 } 2388 }
2389 2389
2390 void ExtensionService::OnProfileDestructionStarted() { 2390 void ExtensionService::OnProfileDestructionStarted() {
2391 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2391 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2392 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2392 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2393 it != ids_to_unload.end(); 2393 it != ids_to_unload.end();
2394 ++it) { 2394 ++it) {
2395 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2395 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2396 } 2396 }
2397 } 2397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698