| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 id, Extension::DISABLE_PERMISSIONS_INCREASE); | 539 id, Extension::DISABLE_PERMISSIONS_INCREASE); |
| 540 const base::Version& expected_version = pending_extension_info->version(); | 540 const base::Version& expected_version = pending_extension_info->version(); |
| 541 if (has_permissions_increase || | 541 if (has_permissions_increase || |
| 542 pending_extension_info->remote_install() || | 542 pending_extension_info->remote_install() || |
| 543 !expected_version.IsValid()) { | 543 !expected_version.IsValid()) { |
| 544 installer->set_grant_permissions(false); | 544 installer->set_grant_permissions(false); |
| 545 } else { | 545 } else { |
| 546 installer->set_expected_version(expected_version, | 546 installer->set_expected_version(expected_version, |
| 547 false /* fail_install_if_unexpected */); | 547 false /* fail_install_if_unexpected */); |
| 548 } | 548 } |
| 549 creation_flags = pending_extension_info->creation_flags(); |
| 549 if (pending_extension_info->mark_acknowledged()) | 550 if (pending_extension_info->mark_acknowledged()) |
| 550 external_install_manager_->AcknowledgeExternalExtension(id); | 551 external_install_manager_->AcknowledgeExternalExtension(id); |
| 551 } else if (extension) { | 552 } else if (extension) { |
| 552 installer->set_install_source(extension->location()); | 553 installer->set_install_source(extension->location()); |
| 553 } | 554 } |
| 554 // If the extension was installed from or has migrated to the webstore, or | 555 // If the extension was installed from or has migrated to the webstore, or |
| 555 // its auto-update URL is from the webstore, treat it as a webstore install. | 556 // its auto-update URL is from the webstore, treat it as a webstore install. |
| 556 // Note that we ignore some older extensions with blank auto-update URLs | 557 // Note that we ignore some older extensions with blank auto-update URLs |
| 557 // because we are mostly concerned with restrictions on NaCl extensions, | 558 // because we are mostly concerned with restrictions on NaCl extensions, |
| 558 // which are newer. | 559 // which are newer. |
| (...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2466 } | 2467 } |
| 2467 | 2468 |
| 2468 void ExtensionService::OnProfileDestructionStarted() { | 2469 void ExtensionService::OnProfileDestructionStarted() { |
| 2469 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2470 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2470 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2471 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2471 it != ids_to_unload.end(); | 2472 it != ids_to_unload.end(); |
| 2472 ++it) { | 2473 ++it) { |
| 2473 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2474 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2474 } | 2475 } |
| 2475 } | 2476 } |
| OLD | NEW |