| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 id, Extension::DISABLE_PERMISSIONS_INCREASE); | 541 id, Extension::DISABLE_PERMISSIONS_INCREASE); |
| 542 const base::Version& expected_version = pending_extension_info->version(); | 542 const base::Version& expected_version = pending_extension_info->version(); |
| 543 if (has_permissions_increase || | 543 if (has_permissions_increase || |
| 544 pending_extension_info->remote_install() || | 544 pending_extension_info->remote_install() || |
| 545 !expected_version.IsValid()) { | 545 !expected_version.IsValid()) { |
| 546 installer->set_grant_permissions(false); | 546 installer->set_grant_permissions(false); |
| 547 } else { | 547 } else { |
| 548 installer->set_expected_version(expected_version, | 548 installer->set_expected_version(expected_version, |
| 549 false /* fail_install_if_unexpected */); | 549 false /* fail_install_if_unexpected */); |
| 550 } | 550 } |
| 551 creation_flags = pending_extension_info->creation_flags(); | |
| 552 if (pending_extension_info->mark_acknowledged()) | 551 if (pending_extension_info->mark_acknowledged()) |
| 553 external_install_manager_->AcknowledgeExternalExtension(id); | 552 external_install_manager_->AcknowledgeExternalExtension(id); |
| 554 } else if (extension) { | 553 } else if (extension) { |
| 555 installer->set_install_source(extension->location()); | 554 installer->set_install_source(extension->location()); |
| 556 } | 555 } |
| 557 // If the extension was installed from or has migrated to the webstore, or | 556 // If the extension was installed from or has migrated to the webstore, or |
| 558 // its auto-update URL is from the webstore, treat it as a webstore install. | 557 // its auto-update URL is from the webstore, treat it as a webstore install. |
| 559 // Note that we ignore some older extensions with blank auto-update URLs | 558 // Note that we ignore some older extensions with blank auto-update URLs |
| 560 // because we are mostly concerned with restrictions on NaCl extensions, | 559 // because we are mostly concerned with restrictions on NaCl extensions, |
| 561 // which are newer. | 560 // which are newer. |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2433 } | 2432 } |
| 2434 | 2433 |
| 2435 void ExtensionService::OnProfileDestructionStarted() { | 2434 void ExtensionService::OnProfileDestructionStarted() { |
| 2436 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2435 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2437 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2436 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2438 it != ids_to_unload.end(); | 2437 it != ids_to_unload.end(); |
| 2439 ++it) { | 2438 ++it) { |
| 2440 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2439 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2441 } | 2440 } |
| 2442 } | 2441 } |
| OLD | NEW |