Commit b0874af3 authored by avayvod@chromium.org's avatar avayvod@chromium.org

[cros] Tooltips for photo and file buttons on change picture settings page.

R=altimofeev@chromium.org
BUG=chromium-os:14419
TEST=Hover with the mouse over the buttons and verify that correct and localized tooltips are shown.

Review URL: http://codereview.chromium.org/7639016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96547 0039d316-1c4b-4281-b951-d872f2087c98
parent 0744cc71
...@@ -37,9 +37,11 @@ cr.define('options', function() { ...@@ -37,9 +37,11 @@ cr.define('options', function() {
// other buttons. // other buttons.
this.addUserImage_( this.addUserImage_(
'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO',
localStrings.getString('takePhoto'),
this.handleTakePhoto_); this.handleTakePhoto_);
this.addUserImage_( this.addUserImage_(
'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE',
localStrings.getString('chooseFile'),
this.handleChooseFile_); this.handleChooseFile_);
chrome.send('getAvailableImages'); chrome.send('getAvailableImages');
}, },
...@@ -77,12 +79,15 @@ cr.define('options', function() { ...@@ -77,12 +79,15 @@ cr.define('options', function() {
/** /**
* Appends new image to the end of the image list. * Appends new image to the end of the image list.
* @param {string} src A url for the user image. * @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. * @param {function} clickHandler A handler for click on image.
* @private * @private
*/ */
addUserImage_: function(src, clickHandler) { addUserImage_: function(src, title, clickHandler) {
var imageElement = document.createElement('img'); var imageElement = document.createElement('img');
imageElement.src = src; imageElement.src = src;
if (title)
imageElement.title = title;
imageElement.addEventListener('click', imageElement.addEventListener('click',
clickHandler, clickHandler,
false); false);
...@@ -100,7 +105,7 @@ cr.define('options', function() { ...@@ -100,7 +105,7 @@ cr.define('options', function() {
addUserImages_: function(images) { addUserImages_: function(images) {
for (var i = 0; i < images.length; i++) { for (var i = 0; i < images.length; i++) {
var imageUrl = images[i]; var imageUrl = images[i];
this.addUserImage_(imageUrl, this.handleImageClick_); this.addUserImage_(imageUrl, "", this.handleImageClick_);
} }
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment