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

Unified Diff: chrome/browser/resources/options/chromeos/change_picture_options.js

Issue 7639016: [cros] Tooltips for photo and file buttons on change picture settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/chromeos/change_picture_options.js
diff --git a/chrome/browser/resources/options/chromeos/change_picture_options.js b/chrome/browser/resources/options/chromeos/change_picture_options.js
index 2d245f1432b283e81413b3144faab58e0bf1a898..650c7808c052091f0abdde74b40c2d47a84ca234 100644
--- a/chrome/browser/resources/options/chromeos/change_picture_options.js
+++ b/chrome/browser/resources/options/chromeos/change_picture_options.js
@@ -37,9 +37,11 @@ cr.define('options', function() {
// other buttons.
this.addUserImage_(
'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO',
+ localStrings.getString('takePhoto'),
this.handleTakePhoto_);
this.addUserImage_(
'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE',
+ localStrings.getString('chooseFile'),
this.handleChooseFile_);
chrome.send('getAvailableImages');
},
@@ -77,12 +79,15 @@ cr.define('options', function() {
/**
* Appends new image to the end of the image list.
* @param {string} src A url for the user image.
+ * @param {string} title A tooltip for the image.
* @param {function} clickHandler A handler for click on image.
* @private
*/
- addUserImage_: function(src, clickHandler) {
+ addUserImage_: function(src, title, clickHandler) {
var imageElement = document.createElement('img');
imageElement.src = src;
+ if (title)
+ imageElement.title = title;
imageElement.addEventListener('click',
clickHandler,
false);
@@ -100,7 +105,7 @@ cr.define('options', function() {
addUserImages_: function(images) {
for (var i = 0; i < images.length; i++) {
var imageUrl = images[i];
- this.addUserImage_(imageUrl, this.handleImageClick_);
+ this.addUserImage_(imageUrl, "", this.handleImageClick_);
}
},
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698