Chromium Code Reviews
DescriptionMD 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 #Depends on Patchset: Dependent Patchsets: Messages
Total messages: 20 (12 generated)
|