Commit a97f3d60 authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Fix DCHECK when searching OS settings for not-found string

The C++ OSSyncHandler is only instantiated when the SplitSettingsSync
flag is set. However, the new os-sync-controls HTML/JS can be
instantiated by a search event when the flag is not set. This leads
to a DCHECK for an unhandled message.

Only instantiate the HTML if the flag is set. Do the same for the
old UI.

Fixed: 1044369
Change-Id: If09060e9916405afc524e669f235166cedf8c4eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017986Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734718}
parent defa7525
...@@ -172,23 +172,27 @@ ...@@ -172,23 +172,27 @@
</template> </template>
<!-- Pre-SplitSettingsSync we show the browser's sync controls. --> <!-- Pre-SplitSettingsSync we show the browser's sync controls. -->
<template is="dom-if" route-path="/syncSetup/advanced"> <template is="dom-if" if="[[!splitSettingsSyncEnabled_]]">
<settings-subpage page-title="$i18n{syncAdvancedPageTitle}" <template is="dom-if" route-path="/syncSetup/advanced">
associated-control="[[$$('#sync-setup')]]" <settings-subpage page-title="$i18n{syncAdvancedPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}"> associated-control="[[$$('#sync-setup')]]"
<settings-sync-controls sync-status="[[syncStatus]]"> learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
</settings-sync-controls> <settings-sync-controls sync-status="[[syncStatus]]">
</settings-subpage> </settings-sync-controls>
</settings-subpage>
</template>
</template> </template>
<!-- Post-SplitSettingsSync we have separate OS sync controls. --> <!-- Post-SplitSettingsSync we have separate OS sync controls. -->
<template is="dom-if" route-path="/osSync"> <template is="dom-if" if="[[splitSettingsSyncEnabled_]]">
<settings-subpage page-title="$i18n{osSyncPageTitle}" <template is="dom-if" route-path="/osSync">
associated-control="[[$$('#sync-setup')]]" <settings-subpage page-title="$i18n{osSyncPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}"> associated-control="[[$$('#sync-setup')]]"
<os-sync-controls sync-status="[[syncStatus]]"> learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
</os-sync-controls> <os-sync-controls sync-status="[[syncStatus]]">
</settings-subpage> </os-sync-controls>
</settings-subpage>
</template>
</template> </template>
<template is="dom-if" route-path="/lockScreen"> <template is="dom-if" route-path="/lockScreen">
......
...@@ -22,7 +22,9 @@ cr.define('settings', function() { ...@@ -22,7 +22,9 @@ cr.define('settings', function() {
if (!loadTimeData.getBoolean('isGuest')) { if (!loadTimeData.getBoolean('isGuest')) {
r.PEOPLE = r.BASIC.createSection('/people', 'people'); r.PEOPLE = r.BASIC.createSection('/people', 'people');
r.SYNC = r.PEOPLE.createChild('/syncSetup'); r.SYNC = r.PEOPLE.createChild('/syncSetup');
r.SYNC_ADVANCED = r.SYNC.createChild('/syncSetup/advanced'); if (!loadTimeData.getBoolean('splitSettingsSyncEnabled')) {
r.SYNC_ADVANCED = r.SYNC.createChild('/syncSetup/advanced');
}
} }
r.INTERNET = r.BASIC.createSection('/internet', 'internet'); r.INTERNET = r.BASIC.createSection('/internet', 'internet');
...@@ -102,8 +104,7 @@ cr.define('settings', function() { ...@@ -102,8 +104,7 @@ cr.define('settings', function() {
r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y');
if (!loadTimeData.getBoolean('isGuest')) { if (!loadTimeData.getBoolean('isGuest')) {
if (loadTimeData.valueExists('splitSettingsSyncEnabled') && if (loadTimeData.getBoolean('splitSettingsSyncEnabled')) {
loadTimeData.getBoolean('splitSettingsSyncEnabled')) {
r.OS_SYNC = r.PEOPLE.createChild('/osSync'); r.OS_SYNC = r.PEOPLE.createChild('/osSync');
} }
// Personalization // Personalization
......
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