Fix Language List in Settings

Desktop / Chromium - Claudio Magni [chromium.org] - 12 October 2017 08:46 EDT

In this change we fix: 1) Translation can be enable/disabled for region-specific languages too. 2) The state of translation is kept in sync for each language of the same family. 3) Adding a language does not remove translation of that language family if there is at least another language from that family in the list already. 4) Removing a language will remove it from the blocked list too. 5) All Chinese languages are handled correctly now.

All changes are behind a default-disabled feature.

This is the second change for Language Settings: the first one was 670459.

Bug: 719760 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I5599b74797f2f135ef0be2e5e03c11c9ca37881b Reviewed-on: https://chromium-review.googlesource.com/683935 Commit-Queue: Claudio M

497822f Fix Language List in Settings.
.../language_settings_private_api.cc | 61 +++-
.../language_settings_private_api.h | 22 ++
.../resources/settings/languages_page/languages.js | 14 +-
.../translate_manager_render_view_host_unittest.cc | 4 +-
.../extensions/api/language_settings_private.idl | 4 +
.../translate/translate_helper_browsertest.cc | 12 +-
.../settings/fake_language_settings_private.js | 24 ++
.../translate/core/browser/translate_prefs.cc | 94 ++++--
.../translate/core/browser/translate_prefs.h | 17 ++
.../core/browser/translate_prefs_unittest.cc | 323 +++++++++++++++++++--
.../core/browser/translate_ui_delegate.cc | 3 +-
components/translate/core/common/translate_util.cc | 36 ++-
components/translate/core/common/translate_util.h | 9 +-
.../core/common/translate_util_unittest.cc | 48 +++
.../browser/extension_function_histogram_value.h | 1 +
...ranslate_collection_view_controller_unittest.mm | 2 +-
.../translate/cwv_translation_controller.mm | 3 +-
.../externs/language_settings_private.js | 11 +-
.../language_settings_private_interface.js | 12 +-
tools/metrics/histograms/enums.xml | 7 +-
20 files changed, 625 insertions(+), 82 deletions(-)

Upstream: git.chromium.org


  • Share