зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1601067 - Only send ActionDelegate:Attached when the delegate is not null. r=snorp
We use this to send a default action to the embedder, but if no one is listening there's no point, and it causes problems in tests because sometimes the delegate is attached / reattached too quickly and the second delegate will end up getting two messages by mistake. Differential Revision: https://phabricator.services.mozilla.com/D72974
This commit is contained in:
Родитель
04097efffa
Коммит
df91383e8d
|
@ -1578,8 +1578,10 @@ public class WebExtension {
|
||||||
final GeckoBundle bundle = new GeckoBundle(1);
|
final GeckoBundle bundle = new GeckoBundle(1);
|
||||||
bundle.putString("extensionId", id);
|
bundle.putString("extensionId", id);
|
||||||
|
|
||||||
EventDispatcher.getInstance().dispatch(
|
if (delegate != null) {
|
||||||
"GeckoView:ActionDelegate:Attached", bundle);
|
EventDispatcher.getInstance().dispatch(
|
||||||
|
"GeckoView:ActionDelegate:Attached", bundle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Describes the signed status for a {@link WebExtension}.
|
/** Describes the signed status for a {@link WebExtension}.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче