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 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1577 // When upgrading to Chrome 10, "omnibox" will be recognized and Chrome | 1577 // When upgrading to Chrome 10, "omnibox" will be recognized and Chrome |
1578 // will disable the extension and prompt the user to approve the increase | 1578 // will disable the extension and prompt the user to approve the increase |
1579 // in privileges. The extension could then release a new version that | 1579 // in privileges. The extension could then release a new version that |
1580 // removes the "omnibox" permission. When the user upgrades, Chrome will | 1580 // removes the "omnibox" permission. When the user upgrades, Chrome will |
1581 // still remember that "omnibox" had been granted, so that if the | 1581 // still remember that "omnibox" had been granted, so that if the |
1582 // extension once again includes "omnibox" in an upgrade, the extension | 1582 // extension once again includes "omnibox" in an upgrade, the extension |
1583 // can upgrade without requiring this user's approval. | 1583 // can upgrade without requiring this user's approval. |
1584 int disable_reasons = extension_prefs_->GetDisableReasons(extension->id()); | 1584 int disable_reasons = extension_prefs_->GetDisableReasons(extension->id()); |
1585 | 1585 |
1586 bool auto_grant_permission = | 1586 bool auto_grant_permission = |
1587 (!is_extension_installed && extension->was_installed_by_default()) || | 1587 extension->was_installed_by_default() || |
1588 extensions::ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode(); | 1588 extensions::ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode(); |
1589 // Silently grant all active permissions to default apps only on install. | 1589 // Silently grant all active permissions to default apps and apps installed |
1590 // After install they should behave like other apps. | 1590 // in kiosk mode. |
not at google - send to devlin
2015/02/17 18:30:36
nit: move this comment above the assignment to aut
| |
1591 // Silently grant all active permissions to apps install in kiosk mode on both | |
1592 // install and update. | |
1593 if (auto_grant_permission) | 1591 if (auto_grant_permission) |
1594 GrantPermissions(extension); | 1592 GrantPermissions(extension); |
1595 | 1593 |
1596 bool is_privilege_increase = false; | 1594 bool is_privilege_increase = false; |
1597 // We only need to compare the granted permissions to the current permissions | 1595 // We only need to compare the granted permissions to the current permissions |
1598 // if the extension is not allowed to silently increase its permissions. | 1596 // if the extension is not allowed to silently increase its permissions. |
1599 if (!extensions::PermissionsData::CanSilentlyIncreasePermissions(extension) && | 1597 if (!extensions::PermissionsData::CanSilentlyIncreasePermissions(extension) && |
1600 !auto_grant_permission) { | 1598 !auto_grant_permission) { |
1601 // Add all the recognized permissions if the granted permissions list | 1599 // Add all the recognized permissions if the granted permissions list |
1602 // hasn't been initialized yet. | 1600 // hasn't been initialized yet. |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2549 } | 2547 } |
2550 | 2548 |
2551 void ExtensionService::OnProfileDestructionStarted() { | 2549 void ExtensionService::OnProfileDestructionStarted() { |
2552 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2550 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2553 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2551 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2554 it != ids_to_unload.end(); | 2552 it != ids_to_unload.end(); |
2555 ++it) { | 2553 ++it) { |
2556 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2554 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2557 } | 2555 } |
2558 } | 2556 } |
OLD | NEW |