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

Unified Diff: chrome/browser/resources/chromeos/user_images_grid.js

Issue 920813002: chromeos: Cats avatar added to defaults set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 5 years, 10 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/chromeos/user_images_grid.js
diff --git a/chrome/browser/resources/chromeos/user_images_grid.js b/chrome/browser/resources/chromeos/user_images_grid.js
index adcf6a7357bf17b1ba57db96ef7f2f0418545cdb..c64623aefe854ffca947950238e8e25fcaf8378a 100644
--- a/chrome/browser/resources/chromeos/user_images_grid.js
+++ b/chrome/browser/resources/chromeos/user_images_grid.js
@@ -635,6 +635,22 @@ cr.define('options', function() {
this.columns = 0;
this.redraw();
this.focus();
+ },
+
+ /**
+ * Appends default images to the image grid. Should only be called once.
+ * @param {Array.<{url: string, author: string,
+ * website: string, title: string}>} imagesData
+ * An array of default images data, including URL, author, title and
+ * website.
+ */
+ setDefaultImages: function(imagesData) {
+ for (var i = 0, data; data = imagesData[i]; i++) {
+ var item = this.addItem(data.url, data.title);
+ item.type = 'default';
+ item.author = data.author || '';
+ item.website = data.website || '';
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698