| 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 "extensions/browser/warning_service.h" | 5 #include "extensions/browser/warning_service.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
| 8 #include "extensions/browser/extension_registry.h" | 8 #include "extensions/browser/extension_registry.h" |
| 9 #include "extensions/browser/extensions_browser_client.h" | 9 #include "extensions/browser/extensions_browser_client.h" |
| 10 #include "extensions/browser/warning_service_factory.h" | 10 #include "extensions/browser/warning_service_factory.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 void WarningService::NotifyWarningsChanged( | 118 void WarningService::NotifyWarningsChanged( |
| 119 const ExtensionIdSet& affected_extensions) { | 119 const ExtensionIdSet& affected_extensions) { |
| 120 for (auto& observer : observer_list_) | 120 for (auto& observer : observer_list_) |
| 121 observer.ExtensionWarningsChanged(affected_extensions); | 121 observer.ExtensionWarningsChanged(affected_extensions); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void WarningService::OnExtensionUnloaded( | 124 void WarningService::OnExtensionUnloaded( |
| 125 content::BrowserContext* browser_context, | 125 content::BrowserContext* browser_context, |
| 126 const Extension* extension, | 126 const Extension* extension, |
| 127 UnloadedExtensionInfo::Reason reason) { | 127 UnloadedExtensionReason reason) { |
| 128 // Unloading one extension might have solved the problems of others. | 128 // Unloading one extension might have solved the problems of others. |
| 129 // Therefore, we clear warnings of this type for all extensions. | 129 // Therefore, we clear warnings of this type for all extensions. |
| 130 std::set<Warning::WarningType> warning_types = | 130 std::set<Warning::WarningType> warning_types = |
| 131 GetWarningTypesAffectingExtension(extension->id()); | 131 GetWarningTypesAffectingExtension(extension->id()); |
| 132 ClearWarnings(warning_types); | 132 ClearWarnings(warning_types); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace extensions | 135 } // namespace extensions |
| OLD | NEW |