MD Settings: Pass strings to cr_elements and eliminate use of loadTimeData and I18nBehavior |
||||||
Issue descriptionCurrently there is some non trivial string lookup done in the cr_network_* elements. The problem with this is that the sshared components make the assumption that certain strings exist in LoadTimeData, even though they are not directly associated with a particular page. We need to develop a more robust mechanism for handling strings in shared network components. (Currently these components are shared by the Settings and OOBE UI).
,
Dec 7 2016
Maybe we should set up a different directory for elements that are shared across web uis (e.g. settings and OOBE), but that are not "drop-in" elements, e.g. they make assumptions about available strings (or possibly handlers?).
,
Dec 8 2016
as long as you can guarantee these strings will exist for your code, it doesn't matter where. you could create these strings in some other handler if you'd like. re: assert -- yes, there's a runtime error when you attempt to access strings that don't exist via loadTimeData. but that doesn't mean these strings are accessed super often. that's the difference between assert() on startup vs assert() in random policy/extension-controlled cases.
,
Dec 8 2016
I'm not sure I understand the first half of comment #3. We are providing the strings for Settings and OOBE (now). The concern would be about continued maintenance. WRT when we assert, I agree that there is some risk in not checking all possible strings at load time, but I question whether it is worth the overhead, which would be incurred for every instance of the control (which, in the case of policy indicators, is rather frequent).
,
Dec 8 2016
stevenjb@: meaning, right now we add a bunch of strings in 2 different places (settings, OOBE). what we could do instead is extract the strings needed from both places and make a new handler (or method of injecting these strings) that lives in ui/webui, closer to the shared UI components themselves. does that make more sense?
,
Dec 8 2016
Ah, yes, that makes sense. I am fine with moving the strings to a shared / separate handler. The code has already been structured to make it easy for OOBE to use the strings defined for Settings. What priority would you place this cleanup? Pre or post shipping MD Settings?
,
Dec 13 2016
Marking this for 58 unless we decide it is a priority.
,
Jan 11 2017
This also needs to be done fro cr_elements/policy.
,
Jan 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7482287f45c241d6fa567c6037c87382ec7b79a1 commit 7482287f45c241d6fa567c6037c87382ec7b79a1 Author: stevenjb <stevenjb@chromium.org> Date: Thu Jan 12 01:08:21 2017 Eliminate loadTimeData dependency from cr_elements/policy BUG= 670767 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2624043002 Cr-Commit-Position: refs/heads/master@{#443100} [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/chrome/browser/resources/settings/settings_ui/compiled_resources2.gyp [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/chrome/browser/resources/settings/settings_ui/settings_ui.js [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.js [modify] https://crrev.com/7482287f45c241d6fa567c6037c87382ec7b79a1/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
,
Jan 17 2017
,
Jan 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/693b38c3882550aabf0ad1d706635e3c7810d855 commit 693b38c3882550aabf0ad1d706635e3c7810d855 Author: stevenjb <stevenjb@chromium.org> Date: Thu Jan 19 17:36:43 2017 WebUI: Remove i18n from cr_elements/network This includes changes in cr_onc_types.js to allow enums to be used as @param types. BUG= 670767 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2627023006 Cr-Commit-Position: refs/heads/master@{#444772} [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/app/chromeos_strings.grdp [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/app/settings_strings.grdp [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/chromeos/login/oobe_welcome.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/chromeos/network_ui/network_ui.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/settings/internet_page/internet_detail_page.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/settings/settings_resources.grd [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/settings/settings_ui/compiled_resources2.gyp [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/settings/settings_ui/settings_ui.html [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/resources/settings/settings_ui/settings_ui.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc [add] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc [add] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/chromeos/network_ui.cc [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.h [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/ui/webui/resources/cr_elements/network/compiled_resources2.gyp [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/ui/webui/resources/cr_elements/network/cr_network_list_item.html [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/ui/webui/resources/cr_elements/network/cr_network_list_item.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/ui/webui/resources/cr_elements/network/cr_network_select.js [modify] https://crrev.com/693b38c3882550aabf0ad1d706635e3c7810d855/ui/webui/resources/cr_elements/network/cr_onc_types.js
,
Jan 19 2017
,
Mar 31 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by steve...@chromium.org
, Dec 7 2016