Only invoke translate callbacks once to avoid duplicate notifications.

This fixes a regression where the "page translated" translate info bar
is shown again and again as the user scrolls through a page which was
translated.

Reason:
iOS 12.2 will ship with native IntersectionObserver support. This means
that html content is no longer translated in full, but rather translated
incrementally as the user scrolls the elements into view. Each
incremental translation will fire off a "translate completed" callback,
but only the first one should be handled.

Bug: 925329
Change-Id: If780a7249329bf1458f2e5ea53290be8a5f9288a
Reviewed-on: https://chromium-review.googlesource.com/c/1437525
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627612}(cherry picked from commit 591b145bf81bf2d7763f4fbd0fc902ee96225064)
Reviewed-on: https://chromium-review.googlesource.com/c/1450393
Reviewed-by: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#124}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
1 file changed