This will give us free close button, free sizing logic, and uniform styles across MD web UIs.
Adding a bit more context: cr-dialog already used by many WebUI pages (Settings, History, OOBE, User manager), and already provides the notions of a close button, header, body and button container, see [1]. On top of that, it has been refined to handle complex corner cases when the window is becoming too small. A lot of this logic is currently repeated in MD Extensions dialogs, for example within [2]. Re-using cr-dialog should allow for removing a lot of duplicate logic, as well as ensuring that our dialogs our consistent across WebUI pages. [1] https://cs.chromium.org/chromium/src/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html?q=cr_dialog.html&sq=package:chromium&dr&l=132,141,144 [2] https://cs.chromium.org/chromium/src/chrome/browser/resources/md_extensions/pack_dialog.html
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c commit 52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c Author: Scott Chen <scottchen@chromium.org> Date: Fri Jul 14 01:17:23 2017 MD Extensions: replace native dialog usages with cr-dialog. Bug: 739920 Change-Id: I3a58618b410acd1ae66811af0a5688187279dbd5 Reviewed-on: https://chromium-review.googlesource.com/567233 Commit-Queue: Scott Chen <scottchen@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#486594} [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/browser/resources/md_extensions/load_error.html [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/browser/resources/md_extensions/options_dialog.html [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/browser/resources/md_extensions/options_dialog.js [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/browser/resources/md_extensions/pack_dialog.html [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/browser/ui/webui/extensions/extensions_ui.cc [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/test/data/webui/extensions/extension_load_error_test.js [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/test/data/webui/extensions/extension_options_dialog_test.js [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/chrome/test/data/webui/extensions/extension_pack_dialog_test.js [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html [modify] https://crrev.com/52a9ace924868ad72ad5e28fc05d9f4c9aa63d6c/ui/webui/resources/cr_elements/shared_style_css.html
Comment 1 by dpa...@chromium.org
, Jul 6 2017