| 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 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 continue; | 2388 continue; |
| 2389 } | 2389 } |
| 2390 greylist_.Insert(extension); | 2390 greylist_.Insert(extension); |
| 2391 extension_prefs_->SetExtensionBlacklistState(extension->id(), | 2391 extension_prefs_->SetExtensionBlacklistState(extension->id(), |
| 2392 state_map.find(*it)->second); | 2392 state_map.find(*it)->second); |
| 2393 if (registry_->enabled_extensions().Contains(extension->id())) | 2393 if (registry_->enabled_extensions().Contains(extension->id())) |
| 2394 DisableExtension(*it, extensions::Extension::DISABLE_GREYLIST); | 2394 DisableExtension(*it, extensions::Extension::DISABLE_GREYLIST); |
| 2395 } | 2395 } |
| 2396 } | 2396 } |
| 2397 | 2397 |
| 2398 void ExtensionService::ContentVerifyFailed(const std::string& extension_id) { | |
| 2399 DisableExtension(extension_id, Extension::DISABLE_CORRUPTED); | |
| 2400 } | |
| 2401 | |
| 2402 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { | 2398 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { |
| 2403 update_observers_.AddObserver(observer); | 2399 update_observers_.AddObserver(observer); |
| 2404 } | 2400 } |
| 2405 | 2401 |
| 2406 void ExtensionService::RemoveUpdateObserver( | 2402 void ExtensionService::RemoveUpdateObserver( |
| 2407 extensions::UpdateObserver* observer) { | 2403 extensions::UpdateObserver* observer) { |
| 2408 update_observers_.RemoveObserver(observer); | 2404 update_observers_.RemoveObserver(observer); |
| 2409 } | 2405 } |
| 2410 | 2406 |
| 2411 // Used only by test code. | 2407 // Used only by test code. |
| 2412 void ExtensionService::UnloadAllExtensionsInternal() { | 2408 void ExtensionService::UnloadAllExtensionsInternal() { |
| 2413 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2409 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
| 2414 | 2410 |
| 2415 registry_->ClearAll(); | 2411 registry_->ClearAll(); |
| 2416 system_->runtime_data()->ClearAll(); | 2412 system_->runtime_data()->ClearAll(); |
| 2417 | 2413 |
| 2418 // TODO(erikkay) should there be a notification for this? We can't use | 2414 // TODO(erikkay) should there be a notification for this? We can't use |
| 2419 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2415 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
| 2420 // or uninstalled. | 2416 // or uninstalled. |
| 2421 } | 2417 } |
| OLD | NEW |