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 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 std::string()); | 1564 std::string()); |
1565 return; | 1565 return; |
1566 } | 1566 } |
1567 | 1567 |
1568 AddExtension(extension); | 1568 AddExtension(extension); |
1569 } | 1569 } |
1570 | 1570 |
1571 void ExtensionService::CheckPermissionsIncrease(const Extension* extension, | 1571 void ExtensionService::CheckPermissionsIncrease(const Extension* extension, |
1572 bool is_extension_installed) { | 1572 bool is_extension_installed) { |
1573 #if defined(ENABLE_EXTENSIONS) | 1573 #if defined(ENABLE_EXTENSIONS) |
1574 extensions::PermissionsUpdater(profile_).InitializeActivePermissions( | 1574 extensions::PermissionsUpdater(profile_).InitializePermissions(extension); |
1575 extension); | |
1576 | 1575 |
1577 // We keep track of all permissions the user has granted each extension. | 1576 // We keep track of all permissions the user has granted each extension. |
1578 // This allows extensions to gracefully support backwards compatibility | 1577 // This allows extensions to gracefully support backwards compatibility |
1579 // by including unknown permissions in their manifests. When the user | 1578 // by including unknown permissions in their manifests. When the user |
1580 // installs the extension, only the recognized permissions are recorded. | 1579 // installs the extension, only the recognized permissions are recorded. |
1581 // When the unknown permissions become recognized (e.g., through browser | 1580 // When the unknown permissions become recognized (e.g., through browser |
1582 // upgrade), we can prompt the user to accept these new permissions. | 1581 // upgrade), we can prompt the user to accept these new permissions. |
1583 // Extensions can also silently upgrade to less permissions, and then | 1582 // Extensions can also silently upgrade to less permissions, and then |
1584 // silently upgrade to a version that adds these permissions back. | 1583 // silently upgrade to a version that adds these permissions back. |
1585 // | 1584 // |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 } | 2486 } |
2488 | 2487 |
2489 void ExtensionService::OnProfileDestructionStarted() { | 2488 void ExtensionService::OnProfileDestructionStarted() { |
2490 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2489 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2491 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2490 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2492 it != ids_to_unload.end(); | 2491 it != ids_to_unload.end(); |
2493 ++it) { | 2492 ++it) { |
2494 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2493 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2495 } | 2494 } |
2496 } | 2495 } |
OLD | NEW |