Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2561)

Unified Diff: chrome/browser/resources/settings/languages_page/languages.js

Issue 2822863002: MD Settings: Languages; limit platform specific code to the respective platform. (Closed)
Patch Set: Address @michaelpg feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
chrome.send('setProspectiveUILanguage', [languageCode]);
},
@@ -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>
});
})();

Powered by Google App Engine
This is Rietveld 408576698