ui_account_tweaks.js/html is shared by the 'options' UI and 'settings'. We should move it into the Settings directory when we remove 'options'.
The only usage of UIAccountTweeks in MD Settings is at [1]. Specifically these two calls - uiAccountTweaks.UIAccountTweaks.loggedInAsGuest() - uiAccountTweaks.UIAccountTweaks.loggedInAsPublicAccount() The 1st one can be replaced by inspecting loadTimeData instead, see example at [2]. If we can find a replacement for loggedInAsPublicAccount(), then we could probably just remove UIAccountTweeks completely. [1] https://cs.chromium.org/chromium/src/chrome/browser/resources/settings/languages_page/languages_page.js?type=cs&l=165-166 [2] https://cs.chromium.org/chromium/src/chrome/browser/resources/settings/device_page/storage.js?type=cs&q=isGuest+file:%5Esrc/chrome/browser/resources/settings/+package:%5Echromium$&l=56
loggedInAsPublicAccount() is just 'loadTimeData.getBoolean('loggedInAsPublicAccount')' The Settings code is already wrapped in '// <if expr="chromeos">', we can just replace both of these with loadTimeData.
Actually, on closer inspection, the logic in language_page.js is just: loadTimeData.getBoolean('isGuest') which already exists.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/251b6254da44abb62bcf994827986a210c8c167a commit 251b6254da44abb62bcf994827986a210c8c167a Author: Steven Bennetts <stevenjb@chromium.org> Date: Thu Aug 17 18:45:36 2017 WebUI: Elim UIAccountTweaks Eliminating some additional (mostly) unused code from options. This also eliminates the extraneous chromeos/ subdirs in ui/webui/resources/[html|js|css]. Bug: 750855 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I6677945b5a0bd03c4be994c05def36858d63a8a0 For third_party/closure_compiler/compiled_resources2.gyp: TBR=dpapad@chromium.org Change-Id: I6677945b5a0bd03c4be994c05def36858d63a8a0 Reviewed-on: https://chromium-review.googlesource.com/617921 Commit-Queue: Steven Bennetts <stevenjb@chromium.org> Reviewed-by: Michael Giuffrida <michaelpg@chromium.org> Cr-Commit-Position: refs/heads/master@{#495251} [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/components.css [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/components.html [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/components.js [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/settings/languages_page/compiled_resources2.gyp [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/settings/languages_page/languages_page.html [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/resources/settings/languages_page/languages_page.js [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/ui/BUILD.gn [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/chrome/browser/ui/webui/chromeos/ui_account_tweaks.h [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/ui/webui/components_ui.cc [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/third_party/closure_compiler/compiled_resources2.gyp [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/ui/webui/resources/css/chrome_shared.css [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/ui/webui/resources/css/chromeos/ui_account_tweaks.css [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/ui/webui/resources/html/chromeos/ui_account_tweaks.html [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/ui/webui/resources/js/chromeos/compiled_resources2.gyp [delete] https://crrev.com/fb8cd09dfdaf9c033ebec00a3d54c27f16b31909/ui/webui/resources/js/chromeos/ui_account_tweaks.js [modify] https://crrev.com/251b6254da44abb62bcf994827986a210c8c167a/ui/webui/resources/webui_resources.grd
Comment 1 by dpa...@chromium.org
, Jul 31 2017