| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 | 890 |
| 891 extension_prefs_->SetExtensionState(extension_id, Extension::DISABLED); | 891 extension_prefs_->SetExtensionState(extension_id, Extension::DISABLED); |
| 892 extension_prefs_->AddDisableReason(extension_id, disable_reason); | 892 extension_prefs_->AddDisableReason(extension_id, disable_reason); |
| 893 | 893 |
| 894 int include_mask = INCLUDE_ENABLED; | 894 int include_mask = INCLUDE_ENABLED; |
| 895 include_mask |= INCLUDE_TERMINATED; | 895 include_mask |= INCLUDE_TERMINATED; |
| 896 extension = GetExtensionByIdInternal(extension_id, include_mask); | 896 extension = GetExtensionByIdInternal(extension_id, include_mask); |
| 897 if (!extension) | 897 if (!extension) |
| 898 return; | 898 return; |
| 899 | 899 |
| 900 // Move it over to the disabled list. | 900 // Move it over to the disabled list. Don't send a second unload notification |
| 901 // for terminated extensions being disabled. |
| 901 disabled_extensions_.Insert(make_scoped_refptr(extension)); | 902 disabled_extensions_.Insert(make_scoped_refptr(extension)); |
| 902 if (extensions_.Contains(extension->id())) | 903 if (extensions_.Contains(extension->id())) { |
| 903 extensions_.Remove(extension->id()); | 904 extensions_.Remove(extension->id()); |
| 904 else | 905 NotifyExtensionUnloaded(extension, extension_misc::UNLOAD_REASON_DISABLE); |
| 906 } else { |
| 905 terminated_extensions_.Remove(extension->id()); | 907 terminated_extensions_.Remove(extension->id()); |
| 906 | 908 } |
| 907 NotifyExtensionUnloaded(extension, extension_misc::UNLOAD_REASON_DISABLE); | |
| 908 | 909 |
| 909 SyncExtensionChangeIfNeeded(*extension); | 910 SyncExtensionChangeIfNeeded(*extension); |
| 910 | 911 |
| 911 // Deactivating one extension might have solved the problems of others. | 912 // Deactivating one extension might have solved the problems of others. |
| 912 // Therefore, we clear warnings of this type for all extensions. | 913 // Therefore, we clear warnings of this type for all extensions. |
| 913 std::set<ExtensionWarningSet::WarningType> warnings; | 914 std::set<ExtensionWarningSet::WarningType> warnings; |
| 914 extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings); | 915 extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings); |
| 915 extension_warnings_.ClearWarnings(warnings); | 916 extension_warnings_.ClearWarnings(warnings); |
| 916 } | 917 } |
| 917 | 918 |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 extensions::ExtensionHost* extension_host) { | 2625 extensions::ExtensionHost* extension_host) { |
| 2625 if (!extension_host) | 2626 if (!extension_host) |
| 2626 return; | 2627 return; |
| 2627 | 2628 |
| 2628 #if !defined(OS_ANDROID) | 2629 #if !defined(OS_ANDROID) |
| 2629 extensions::LaunchPlatformApp(extension_host->profile(), | 2630 extensions::LaunchPlatformApp(extension_host->profile(), |
| 2630 extension_host->extension(), | 2631 extension_host->extension(), |
| 2631 NULL, FilePath()); | 2632 NULL, FilePath()); |
| 2632 #endif | 2633 #endif |
| 2633 } | 2634 } |
| OLD | NEW |