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

Unified Diff: chrome/common/extensions/docs/examples/api/fontSettings/popup.js

Issue 10716003: [Font Settings API]: Rename fontName and localizedName to fontId and displayName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 5 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/common/extensions/docs/examples/api/fontSettings/popup.js
diff --git a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
index 670ff0db4400f91dc7652f383853ffa2f9be4943..d7439033fa45216330ad3adc1437de901991b558 100644
--- a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
+++ b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
@@ -55,8 +55,8 @@ function populateLists(fonts) {
for (var j = 0; j < fonts.length; j++) {
var item = document.createElement('option');
- item.value = fonts[j].fontName;
- item.text = fonts[j].localizedName;
+ item.value = fonts[j].fontId;
+ item.text = fonts[j].displayName;
list.add(item);
}
}
@@ -74,25 +74,25 @@ function getFontChangeHandler(fontList, genericFamily) {
var details = {};
details.genericFamily = genericFamily;
- details.fontName = font;
+ details.fontId = font;
details.script = script;
chrome.experimental.fontSettings.setFont(details);
};
}
-// Sets the selected value of |fontList| to |fontName|.
-function setSelectedFont(fontList, fontName) {
+// Sets the selected value of |fontList| to |fontId|.
+function setSelectedFont(fontList, fontId) {
var script = getSelectedScript();
var i;
for (i = 0; i < fontList.length; i++) {
- if (fontName == fontList.options[i].value) {
+ if (fontId == fontList.options[i].value) {
fontList.selectedIndex = i;
break;
}
}
if (i == fontList.length) {
- console.warn("font '" + fontName + "' for " + fontList.id + ' for ' +
+ console.warn("font '" + fontId + "' for " + fontList.id + ' for ' +
script + ' is not on the system');
}
}
@@ -101,7 +101,7 @@ function setSelectedFont(fontList, fontName) {
// font returned from |chrome.experimental.fontSettings.getFont|.
function getFontHandler(list) {
return function(details) {
- setSelectedFont(list, details.fontName);
+ setSelectedFont(list, details.fontId);
list.disabled = !isControllableLevel(details.levelOfControl);
};
}

Powered by Google App Engine
This is Rietveld 408576698