chromeos: Fix crash when clicking "Clear browsing data" in settings
I recently added the settings-sync-account-control element to the Chrome OS build: https://chromium-review.googlesource.com/c/chromium/src/+/1978844 The "Clear browsing data" WebUI dialog contains that element. Its Polymer attached() method calls PeopleHandler::GetStoredAccountList which crashes in guest mode because no IdentityManager exists. This didn't crash before because the Polymer element wasn't included in the Chrome OS build, so the DOM element did nothing. Make the C++ handler work in guest mode by returning an empty list. This fixes the crash. Also use a dom-if to remove the settings-sync-account-control from the dialog footer. The Chromium Polymer style guide recommends dom-if when a hidden section contains custom elements. Bug: 1040476 Test: added automated tests Change-Id: Id2f703d0c37784c6525dc9127281530d87231421 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1999238 Commit-Queue: James Cook <jamescook@chromium.org> Reviewed-by:Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/master@{#731575}
Showing
Please register or sign in to comment