Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Issue 2252323002: MD Settings: reduce complexity and overhead of Languages singleton (Closed)

Created:
4 years, 4 months ago by michaelpg
Modified:
4 years, 4 months ago
Reviewers:
stevenjb
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, arv+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@RemoveLanguageInputMethods
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: reduce complexity and overhead of Languages singleton This weird private-singleton + multiple-instance-observer element pattern didn't really pan out. TL;DR: Remove <settings-languages-singleton> and put all the logic in <settings-languages>, create one of those in the languages page, and pass the model around with simple data binding. Currently, we do this: <settings-languages languages="{{languages}}"></settings-languages> in any subpage that needs access to the languages model. While it's cool that they don't have to rely on ancestors for data binding, the logic to make this work is confusing. It's easier to just have one element at the top (i.e. the singleton) and use normal data binding to provide the languages model to subpages. This reduces complexity (eliminates custom-rolled notify/listener logic) and matches how the rest of MD Settings works. BUG=638802 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/75252ef73a6e34b53a5ee8ffdf30e1ffe0b9a300 Cr-Commit-Position: refs/heads/master@{#413019}

Patch Set 1 #

Patch Set 2 : Wrong whitespace to improve diff #

Total comments: 7

Patch Set 3 : Data bind languageHelper #

Patch Set 4 : Reduce diff #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -395 lines) Patch
M chrome/browser/resources/settings/languages_page/language_detail_page.html View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/settings/languages_page/language_detail_page.js View 1 2 5 chunks +9 lines, -14 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/languages.html View 1 chunk +1 line, -7 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/languages.js View 1 2 3 9 chunks +61 lines, -104 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/languages_page.html View 1 2 3 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/languages_page.js View 1 2 3 10 chunks +13 lines, -18 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/languages_types.js View 1 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/manage_input_methods_page.html View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/settings/languages_page/manage_input_methods_page.js View 1 2 3 8 chunks +11 lines, -13 lines 0 comments Download
M chrome/browser/resources/settings/languages_page/manage_languages_page.html View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/settings/languages_page/manage_languages_page.js View 1 2 3 5 chunks +8 lines, -13 lines 0 comments Download
M chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/test/data/webui/settings/languages_page_browsertest.js View 1 2 3 2 chunks +1 line, -3 lines 0 comments Download
D chrome/test/data/webui/settings/languages_page_tests.js View 1 chunk +0 lines, -160 lines 0 comments Download
A + chrome/test/data/webui/settings/languages_tests.js View 1 2 3 1 chunk +72 lines, -46 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 20 (12 generated)
michaelpg
PTAL. The diff summary is a lie, it's just barely a net negative (-30 lines). ...
4 years, 4 months ago (2016-08-18 03:05:29 UTC) #6
stevenjb
This lgtm as-is, but FWIW there would be fewer changes and, I think, just as ...
4 years, 4 months ago (2016-08-18 16:22:03 UTC) #11
michaelpg
This is way better, I wish I had thought of it before sending out the ...
4 years, 4 months ago (2016-08-18 22:32:27 UTC) #12
michaelpg
This is way better, I wish I had thought of it before sending out the ...
4 years, 4 months ago (2016-08-18 22:32:28 UTC) #13
stevenjb
nice. lgtm!
4 years, 4 months ago (2016-08-19 00:16:39 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2252323002/100001
4 years, 4 months ago (2016-08-19 00:22:29 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:100001)
4 years, 4 months ago (2016-08-19 01:47:59 UTC) #18
commit-bot: I haz the power
4 years, 4 months ago (2016-08-19 01:52:09 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/75252ef73a6e34b53a5ee8ffdf30e1ffe0b9a300
Cr-Commit-Position: refs/heads/master@{#413019}

Powered by Google App Engine
This is Rietveld 408576698