Chromium Code Reviews| Index: chrome/browser/resources/settings/languages_page/languages.js |
| diff --git a/chrome/browser/resources/settings/languages_page/languages.js b/chrome/browser/resources/settings/languages_page/languages.js |
| index 40d9eb021d8466609e68b61b6c0b6cf7abe29262..1487392f811540e927dacdad94dc0563525ffd09 100644 |
| --- a/chrome/browser/resources/settings/languages_page/languages.js |
| +++ b/chrome/browser/resources/settings/languages_page/languages.js |
| @@ -483,13 +483,13 @@ Polymer({ |
| return this.resolver_.promise; |
| }, |
| +// <if expr="chromeos or is_win"> |
| /** |
| * Sets the prospective UI language to the chosen language. This won't affect |
| * the actual UI language until a restart. |
| * @param {string} languageCode |
| */ |
| setProspectiveUILanguage: function(languageCode) { |
| - assert(cr.isChromeOS || cr.isWindows); |
|
michaelpg
2017/04/18 05:03:35
I used runtime checks instead of grit because that
dpapad
2017/04/18 18:31:20
AFAIK, GRIT is preferred. This guarantees for exam
|
| chrome.send('setProspectiveUILanguage', [languageCode]); |
|
michaelpg
2017/04/18 05:03:35
Does it makes sense to #ifdef these handlers in C+
dpapad
2017/04/18 18:31:20
Done.
|
| }, |
| @@ -501,6 +501,7 @@ Polymer({ |
| return this.originalProspectiveUILanguage_ != |
| this.languages.prospectiveUILanguage; |
| }, |
| +// </if> |
| /** |
| * @param {string} languageCode |
| @@ -726,18 +727,9 @@ Polymer({ |
| return this.supportedLanguageMap_.get(languageCode); |
| }, |
| - /** |
| - * @param {string} id |
| - * @return {!chrome.languageSettingsPrivate.InputMethod|undefined} |
| - */ |
| - getInputMethod: function(id) { |
| - assert(cr.isChromeOS); |
| - return this.supportedInputMethodMap_.get(id); |
| - }, |
| - |
| +// <if expr="chromeos"> |
| /** @param {string} id */ |
| addInputMethod: function(id) { |
| - assert(cr.isChromeOS); |
| if (!this.supportedInputMethodMap_.has(id)) |
| return; |
| this.languageSettingsPrivate.addInputMethod(id); |
| @@ -745,7 +737,6 @@ Polymer({ |
| /** @param {string} id */ |
| removeInputMethod: function(id) { |
| - assert(cr.isChromeOS); |
| if (!this.supportedInputMethodMap_.has(id)) |
| return; |
| this.languageSettingsPrivate.removeInputMethod(id); |
| @@ -753,7 +744,6 @@ Polymer({ |
| /** @param {string} id */ |
| setCurrentInputMethod: function(id) { |
| - assert(cr.isChromeOS); |
| this.inputMethodPrivate.setCurrentInputMethod(id); |
| }, |
| @@ -770,32 +760,28 @@ Polymer({ |
| * @return {boolean} |
| */ |
| isComponentIme: function(inputMethod) { |
| - assert(cr.isChromeOS); |
| return inputMethod.id.startsWith('_comp_'); |
| }, |
| /** @param {string} id Input method ID. */ |
| openInputMethodOptions: function(id) { |
| - assert(cr.isChromeOS); |
| this.inputMethodPrivate.openOptionsPage(id); |
| }, |
| /** @param {string} id New current input method ID. */ |
| onInputMethodChanged_: function(id) { |
| - assert(cr.isChromeOS); |
| this.set('languages.inputMethods.currentId', id); |
| }, |
| /** @param {string} id Added input method ID. */ |
| onInputMethodAdded_: function(id) { |
| - assert(cr.isChromeOS); |
| this.updateEnabledInputMethods_(); |
| }, |
| /** @param {string} id Removed input method ID. */ |
| onInputMethodRemoved_: function(id) { |
| - assert(cr.isChromeOS); |
| this.updateEnabledInputMethods_(); |
| }, |
| +// </if> |
| }); |
| })(); |