Commit 6a7c83a9 authored by Randy Rossi's avatar Randy Rossi Committed by Commit Bot

Add UnloadExtension method

This CL adds a method to unload a previously loaded
extension.

Bug: b/73383411
Test: None
Change-Id: Id9f801c5c0296ba9748bfbd4417797f7f4eddb6d
Reviewed-on: https://chromium-review.googlesource.com/1070457Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Commit-Queue: Randy Rossi <rmrossi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561610}
parent 864136ef
......@@ -133,6 +133,11 @@ const Extension* CastExtensionSystem::LoadExtension(
return extension.get();
}
void CastExtensionSystem::UnloadExtension(const std::string& extension_id,
UnloadedExtensionReason reason) {
extension_registrar_->RemoveExtension(extension_id, reason);
}
void CastExtensionSystem::PostLoadExtension(
const scoped_refptr<extensions::Extension>& extension) {
extension_registrar_->AddExtension(extension);
......
......@@ -41,6 +41,10 @@ class CastExtensionSystem : public ExtensionSystem,
// Load an extension from the contents of a manifest file.
const Extension* LoadExtensionByManifest(const std::string& manifest);
// Unload an extension.
void UnloadExtension(const std::string& extension_id,
UnloadedExtensionReason reason);
// Loads an unpacked platform app from a directory. Returns the extension on
// success, or nullptr otherwise.
// Currently this just calls LoadExtension, as apps are not loaded differently
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment