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

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

Issue 8879015: [cros] Profile image no longer selected when user clicks Take Photo/Choose File buttons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc » ('j') | 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 338ce539af0c58d1706c99a6ae4eb1426e8555cc..abdf44a1d01374a60b37bab4e7efc9f074cb2a32 100644
--- a/chrome/browser/resources/options/chromeos/change_picture_options.js
+++ b/chrome/browser/resources/options/chromeos/change_picture_options.js
@@ -48,13 +48,8 @@ cr.define('options', function() {
var imageGrid = $('images-grid');
UserImagesGrid.decorate(imageGrid);
- imageGrid.addEventListener('change', function(e) {
- // Ignore programmatical selection.
- if (!imageGrid.inProgramSelection) {
- // Button selections will be ignored by Chrome handler.
- chrome.send('selectImage', [this.selectedItemUrl || '']);
- }
- });
+ imageGrid.addEventListener('change',
+ this.handleImageSelected_.bind(this));
imageGrid.addEventListener('activate',
this.handleImageActivated_.bind(this));
imageGrid.addEventListener('dblclick',
@@ -120,6 +115,20 @@ cr.define('options', function() {
},
/**
+ * Handles image selection change.
+ * @private
+ */
+ handleImageSelected_: function() {
+ var imageGrid = $('images-grid');
+ var url = imageGrid.selectedItemUrl;
+ // Ignore empty, programmatical and button selection.
whywhat 2011/12/08 17:27:50 I'd rather tell reader here what empty url and pro
Ivan Korotkov 2011/12/09 09:30:23 Done.
+ if (!imageGrid.inProgramSelection &&
whywhat 2011/12/08 17:27:50 I'd reorder and reformat like this: if (url &&
Ivan Korotkov 2011/12/09 09:30:23 Done.
+ url && ButtonImageUrls.indexOf(url) == -1) {
+ chrome.send('selectImage', [url]);
+ }
+ },
+
+ /**
* Handles image activation (by pressing Enter).
* @private
*/
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698