Commit b13df0ca authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Commit Bot

Fix DCHECK in Assistant deep links

The deep link from the Assistant Settings window still used
chrome://settings/googleAssistant instead of the new path
chrome://os-settings/googleAssistant.

Bug: 956971
Change-Id: Id0cfcbf22613a378f253af805fb76cda12e81357
Tests: ash_unittests --gtest_filter="DeepLinkUtilTest*.*" and manually reproduced.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398509
Commit-Queue: Jeroen Dhollander <jeroendh@chromium.org>
Auto-Submit: Jeroen Dhollander <jeroendh@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805511}
parent 35c44df9
......@@ -464,9 +464,14 @@ GURL GetChromeSettingsUrl(const base::Optional<std::string>& page) {
// top-level Chrome OS Settings. We may wish to allow deep linking into
// Browser Settings at some point in the future at which point we will define
// an analogous collection of |kAllowedBrowserPages|.
// These values are copied from
// chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.
// We can not reuse the generated defines as we can not depend on //chrome.
// TODO(b/168138594): use generated defines once that header has been moved to
// chromeos.
static const std::map<std::string, std::string> kAllowedOsPages = {
{/*page=*/"googleAssistant", /*os_page=*/"googleAssistant"},
{/*page=*/"languages", /*os_page=*/"languages/details"}};
{/*page=*/"languages", /*os_page=*/"osLanguages/details"}};
return page && base::Contains(kAllowedOsPages, page.value())
? GURL(kChromeOsSettingsUrl + kAllowedOsPages.at(page.value()))
......
......@@ -850,7 +850,7 @@ TEST_F(DeepLinkUtilTest, GetChromeSettingsUrl) {
{base::Optional<std::string>("googleAssistant"),
"chrome://os-settings/googleAssistant"},
{base::Optional<std::string>("languages"),
"chrome://os-settings/languages/details"},
"chrome://os-settings/osLanguages/details"},
// FALLBACK: Allowed pages are case sensitive.
{base::Optional<std::string>("GOOGLEASSISTANT"), "chrome://os-settings/"},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment