WebView getPrivacyPolicyUrl API should use the same locale as the safe browsing component's URL |
||||
Issue descriptiongetSafeBrowsingPrivacyPolicyUrl() returns a URL containing the user's preferred locale. The idea is to return the same URL that users load when they click on the privacy policy link on the interstitial page. In order to present the help center link in the user's preferred locale, we should make sure we fetch the locale in the same way the Safe Browsing component does [1]. We can use AwBrowserContext::GetDefault()->GetSafeBrowsingUIManager() to get the UIManager, and then use that to fetch the locale. This should be more compatible than AwContents::GetLocale(). We observed subtle differences related to locale in issue 819085 (between the UIManager method and the Java API). [1] https://cs.chromium.org/chromium/src/components/safe_browsing/base_ui_manager.cc?l=310&gsn=app_locale
,
Mar 12 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/27a94038eac4dad814d18a824b4662fb3b246af7 commit 27a94038eac4dad814d18a824b4662fb3b246af7 Author: Nate Fischer <ntfschr@chromium.org> Date: Mon Mar 12 21:51:06 2018 AW: improve locale for getSafeBrowsingPrivacyPolicyUrl This API returns a URL containing the locale as a query parameter. The Google help center uses this to decide in which language to display the page. The old method for obtaining the locale would sometimes return a locale in a format the help center didn't recognize (e.g., "cs-CZ"). Instead, use the UIManager to fetch the locale, to stay consistent with how we generate the URL for actual interstitial pages. This new approach seems more consistent with the help center's expectations (e.g., "cs" instead of "cs-CZ"). the API, observe the page displays in the proper language Bug: 820694 Test: manual - Put device in Czech (cs/cs-CZ) and visit the url returned Change-Id: I72606a2eee00f5b1890f703593267e93fdd645ff Reviewed-on: https://chromium-review.googlesource.com/958229 Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Changwan Ryu <changwan@chromium.org> Commit-Queue: Nate Fischer <ntfschr@chromium.org> Cr-Commit-Position: refs/heads/master@{#542610} [modify] https://crrev.com/27a94038eac4dad814d18a824b4662fb3b246af7/android_webview/browser/aw_browser_context.cc [modify] https://crrev.com/27a94038eac4dad814d18a824b4662fb3b246af7/android_webview/browser/aw_contents_statics.cc [modify] https://crrev.com/27a94038eac4dad814d18a824b4662fb3b246af7/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java
,
Mar 12 2018
,
Mar 12 2018
,
Mar 20 2018
Verified on Nexus 6P/OPM1.171019.028 and Pixel XL /PPR1.180320.001 having 67.0.3376.0 , changing locale reflects in Privacy Policy in Safe browsing apk |
||||
►
Sign in to add a comment |
||||
Comment 1 by ntfschr@chromium.org
, Mar 10 2018346 KB
346 KB View Download
361 KB
361 KB View Download