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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 std::string()); | 1452 std::string()); |
1453 return; | 1453 return; |
1454 } | 1454 } |
1455 | 1455 |
1456 AddExtension(extension); | 1456 AddExtension(extension); |
1457 } | 1457 } |
1458 | 1458 |
1459 void ExtensionService::CheckPermissionsIncrease(const Extension* extension, | 1459 void ExtensionService::CheckPermissionsIncrease(const Extension* extension, |
1460 bool is_extension_installed) { | 1460 bool is_extension_installed) { |
1461 #if defined(ENABLE_EXTENSIONS) | 1461 #if defined(ENABLE_EXTENSIONS) |
1462 extensions::PermissionsUpdater(profile_).InitializeActivePermissions( | 1462 extensions::PermissionsUpdater(profile_).InitializePermissions(extension); |
1463 extension); | |
1464 | 1463 |
1465 // We keep track of all permissions the user has granted each extension. | 1464 // We keep track of all permissions the user has granted each extension. |
1466 // This allows extensions to gracefully support backwards compatibility | 1465 // This allows extensions to gracefully support backwards compatibility |
1467 // by including unknown permissions in their manifests. When the user | 1466 // by including unknown permissions in their manifests. When the user |
1468 // installs the extension, only the recognized permissions are recorded. | 1467 // installs the extension, only the recognized permissions are recorded. |
1469 // When the unknown permissions become recognized (e.g., through browser | 1468 // When the unknown permissions become recognized (e.g., through browser |
1470 // upgrade), we can prompt the user to accept these new permissions. | 1469 // upgrade), we can prompt the user to accept these new permissions. |
1471 // Extensions can also silently upgrade to less permissions, and then | 1470 // Extensions can also silently upgrade to less permissions, and then |
1472 // silently upgrade to a version that adds these permissions back. | 1471 // silently upgrade to a version that adds these permissions back. |
1473 // | 1472 // |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 } | 2342 } |
2344 | 2343 |
2345 void ExtensionService::OnProfileDestructionStarted() { | 2344 void ExtensionService::OnProfileDestructionStarted() { |
2346 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2345 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2347 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2346 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2348 it != ids_to_unload.end(); | 2347 it != ids_to_unload.end(); |
2349 ++it) { | 2348 ++it) { |
2350 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2349 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2351 } | 2350 } |
2352 } | 2351 } |
OLD | NEW |