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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 extension->location(), Manifest::NUM_LOCATIONS); | 1798 extension->location(), Manifest::NUM_LOCATIONS); |
1799 | 1799 |
1800 // A fully installed app cannot be demoted to an ephemeral app. | 1800 // A fully installed app cannot be demoted to an ephemeral app. |
1801 if ((install_flags & extensions::kInstallFlagIsEphemeral) && | 1801 if ((install_flags & extensions::kInstallFlagIsEphemeral) && |
1802 !extension_prefs_->IsEphemeralApp(id)) { | 1802 !extension_prefs_->IsEphemeralApp(id)) { |
1803 install_flags &= ~static_cast<int>(extensions::kInstallFlagIsEphemeral); | 1803 install_flags &= ~static_cast<int>(extensions::kInstallFlagIsEphemeral); |
1804 } | 1804 } |
1805 } | 1805 } |
1806 | 1806 |
1807 if (disable_reasons) | 1807 if (disable_reasons) |
1808 extension_prefs_->AddDisableReasons(id, disable_reasons); | 1808 extension_prefs_->AddDisableReason(id, |
| 1809 static_cast<Extension::DisableReason>(disable_reasons)); |
1809 | 1810 |
1810 const Extension::State initial_state = | 1811 const Extension::State initial_state = |
1811 disable_reasons == Extension::DISABLE_NONE ? Extension::ENABLED | 1812 disable_reasons == Extension::DISABLE_NONE ? Extension::ENABLED |
1812 : Extension::DISABLED; | 1813 : Extension::DISABLED; |
1813 | 1814 |
1814 if (ShouldDelayExtensionUpdate( | 1815 if (ShouldDelayExtensionUpdate( |
1815 id, | 1816 id, |
1816 !!(install_flags & extensions::kInstallFlagInstallImmediately))) { | 1817 !!(install_flags & extensions::kInstallFlagInstallImmediately))) { |
1817 extension_prefs_->SetDelayedInstallInfo( | 1818 extension_prefs_->SetDelayedInstallInfo( |
1818 extension, | 1819 extension, |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 } | 2582 } |
2582 | 2583 |
2583 void ExtensionService::OnProfileDestructionStarted() { | 2584 void ExtensionService::OnProfileDestructionStarted() { |
2584 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2585 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2585 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2586 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2586 it != ids_to_unload.end(); | 2587 it != ids_to_unload.end(); |
2587 ++it) { | 2588 ++it) { |
2588 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2589 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2589 } | 2590 } |
2590 } | 2591 } |
OLD | NEW |