| Index: chrome/browser/resources/options2/chromeos/change_picture_options.js
|
| diff --git a/chrome/browser/resources/options2/chromeos/change_picture_options.js b/chrome/browser/resources/options2/chromeos/change_picture_options.js
|
| index 66c302113f239a6d45b3f8f0c6871ad6b8c7155b..2404337c9164c0ca999becb51878f2fa89ade3d0 100644
|
| --- a/chrome/browser/resources/options2/chromeos/change_picture_options.js
|
| +++ b/chrome/browser/resources/options2/chromeos/change_picture_options.js
|
| @@ -240,13 +240,14 @@ cr.define('options', function() {
|
|
|
| /**
|
| * Appends default images to the image grid. Should only be called once.
|
| - * @param {Array.<string>} images An array of URLs to default images.
|
| + * @param {Array.<{url: string, author: string, website: string}>} images
|
| + * An array of default images data, including URL, author and website.
|
| * @private
|
| */
|
| setDefaultImages_: function(images) {
|
| var imageGrid = $('user-image-grid');
|
| - for (var i = 0, url; url = images[i]; i++) {
|
| - imageGrid.addItem(url);
|
| + for (var i = 0, data; data = imagesData[i]; i++) {
|
| + imageGrid.addItem(data.url);
|
| }
|
| },
|
| };
|
| @@ -389,6 +390,13 @@ cr.define('options', function() {
|
| url != ButtonImages.TAKE_PHOTO && url != ButtonImages.CHOOSE_FILE) {
|
| chrome.send('selectImage', [url]);
|
| }
|
| + // Update image attribution text.
|
| + var image = imageGrid.selectedItem;
|
| + $('user-image-author-name').textContent = image.author;
|
| + $('user-image-author-website').textContent = image.website;
|
| + $('user-image-author-website').href = image.website;
|
| + $('user-image-attribution').style.visibility =
|
| + (image.author || image.website) ? 'visible' : 'hidden';
|
| },
|
|
|
| /**
|
| @@ -461,13 +469,17 @@ cr.define('options', function() {
|
|
|
| /**
|
| * Appends default images to the image grid. Should only be called once.
|
| - * @param {Array.<string>} images An array of URLs to default images.
|
| + * @param {Array.<{url: string, author: string, website: string}>} images
|
| + * An array of default images data, including URL, author and website.
|
| * @private
|
| */
|
| - setDefaultImages_: function(images) {
|
| + setDefaultImages_: function(imagesData) {
|
| var imageGrid = $('user-image-grid');
|
| - for (var i = 0, url; url = images[i]; i++) {
|
| - imageGrid.addItem(url).type = 'default';
|
| + for (var i = 0, data; data = imagesData[i]; i++) {
|
| + var item = imageGrid.addItem(data.url);
|
| + item.type = 'default';
|
| + item.author = data.author || '';
|
| + item.website = data.website || '';
|
| }
|
| },
|
| };
|
|
|