New issue
Advanced search Search tips

Issue 900586 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Handle HrefTranslate attribute

Project Member Reported by anthonyvd@chromium.org, Oct 31

Issue description

https://chromium-review.googlesource.com/c/chromium/src/+/1175031 introduced the HrefTranslate attribute on <a> tags. It's necessary to propagate its value to the browser process and kick off auto-translations as needed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/358a11611344fb76bac117b3bc444c29c204f6a9

commit 358a11611344fb76bac117b3bc444c29c204f6a9
Author: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Date: Fri Nov 02 16:26:42 2018

Add hrefTranslate to NavigationHandle so the browser can handle it

This CL takes the experimental hrefTranslate attribute on <a> tags
and carries it to the creation of NavigationHandle. This allows
Translate browser code to be aware of its value in
ContentTranslateDriver::DidFinishNavigation.

BUG:900586,872777

Change-Id: Ie7c633aca8a91f1137862898c992c5f63cc1fcca
Reviewed-on: https://chromium-review.googlesource.com/c/1308434
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604952}
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/components/translate/content/browser/content_translate_driver.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/navigation_entry_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/browser/navigation_browsertest.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/common/frame_messages.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/common/navigation_params.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/common/navigation_params.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/public/browser/navigation_handle.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/public/test/render_view_test.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/content/renderer/render_frame_impl.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/public/web/web_local_frame_client.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/exported/local_frame_client_impl.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/frame/local_frame_client.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/loader/empty_clients.cc
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/loader/empty_clients.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/loader/frame_load_request.h
[modify] https://crrev.com/358a11611344fb76bac117b3bc444c29c204f6a9/third_party/blink/renderer/core/loader/frame_loader.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df23059bfa6bb0420646b0b132ee61474a367299

commit df23059bfa6bb0420646b0b132ee61474a367299
Author: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Date: Wed Nov 07 21:21:49 2018

Trigger Translate from hrefTranslate links

This patch triggers auto translate behavior on navigations started from
<a> tags that have an hrefTranslate attribute. It also merges the tests
written by Aaron in https://chromium-review.googlesource.com/c/chromium/src/+/1227173.

Bug: 900586
Change-Id: I1b8e23651ff839ab8cafadf02e72ac6ceca108de
Reviewed-on: https://chromium-review.googlesource.com/c/1315949
Reviewed-by: Hajime Hoshi <hajimehoshi@chromium.org>
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606163}
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/chrome/browser/translate/translate_manager_browsertest.cc
[add] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/chrome/test/data/href_translate_test.html
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/components/translate/content/browser/content_translate_driver.cc
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/components/translate/core/browser/language_state.cc
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/components/translate/core/browser/language_state.h
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/components/translate/core/browser/translate_manager_unittest.cc
[modify] https://crrev.com/df23059bfa6bb0420646b0b132ee61474a367299/components/translate/ios/browser/ios_translate_driver.mm

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/93a1167ada9d699c1b555c2d8fee2a0bb226e626

commit 93a1167ada9d699c1b555c2d8fee2a0bb226e626
Author: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Date: Wed Nov 21 16:44:42 2018

Wire up hrefTranslate in OpenURL

This is simply a follow-up on https://chromium-review.googlesource.com/c/1315949
that handles links being opened in a different tab.

Bug: 900586,872777
Change-Id: I212e1d787db30da988dddaff0fc9e29978d7222e
Reviewed-on: https://chromium-review.googlesource.com/c/1331667
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610103}
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/chrome/browser/ui/browser.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/chrome/browser/ui/browser_navigator.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/chrome/browser/ui/browser_navigator_params.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/frame_host/navigator.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/frame_host/navigator_impl.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/browser/security_exploit_browsertest.cc
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/common/frame_messages.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/public/browser/navigation_controller.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/public/browser/page_navigator.h
[modify] https://crrev.com/93a1167ada9d699c1b555c2d8fee2a0bb226e626/content/renderer/render_frame_impl.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Yesterday (35 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b

commit de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b
Author: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Date: Mon Jan 21 21:05:55 2019

Only trigger HrefTranslate if the originator is the DSE

To prevent any website from triggering Chrome auto-translate, the
hrefTranslate attribute on <a> tags will only work automatically when
the originator of the request is the user's default search engine. A
follow up patch will make it so that hrefTranslate from other
originators show the Translate UI.

Context for this change can be found in crbug.com/909088.

Bug: 900586
Change-Id: I41b66382e6f56b7b67eab3ffcca7a93c755cdce7
Reviewed-on: https://chromium-review.googlesource.com/c/1413403
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624670}
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/chrome/browser/translate/chrome_translate_client.cc
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/chrome/browser/translate/translate_manager_browsertest.cc
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/components/translate/content/browser/BUILD.gn
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/components/translate/content/browser/DEPS
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/components/translate/content/browser/content_translate_driver.cc
[modify] https://crrev.com/de1b8f8fd94987a2f7b1a0c0e8a7294117eb021b/components/translate/content/browser/content_translate_driver.h

Sign in to add a comment