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

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_user_image.js

Issue 10969032: [cros] Avatar picker: various fixes for web camera problems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 3 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 | chrome/browser/resources/chromeos/user_images_grid.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
index 8d57b9bfe85fb685095f38718b81f7f6f7f71302..72db3b99249f2612c1229792370df755544b093c 100644
--- a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
@@ -475,9 +475,10 @@ cr.define('oobe', function() {
/**
* Handles selection change.
+ * @param {cr.Event} e Selection change event.
* @private
*/
- handleSelect_: function() {
+ handleSelect_: function(e) {
var imageGrid = $('user-image-grid');
if (imageGrid.selectionType == 'camera' && imageGrid.cameraLive) {
// No current image selected.
@@ -487,8 +488,9 @@ cr.define('oobe', function() {
chrome.send('selectImage', [imageGrid.selectedItemUrl]);
}
// Start/stop camera on (de)selection.
- if (!imageGrid.inProgramSelection) {
- if (imageGrid.selectionType == 'camera' && !imageGrid.cameraOnline) {
+ if (!imageGrid.inProgramSelection &&
+ imageGrid.selectionType != e.oldSelectionType) {
+ if (imageGrid.selectionType == 'camera') {
// Programmatic selection of camera item is done in
// checkCameraPresence callback where streaming is started by itself.
imageGrid.checkCameraPresence(
@@ -499,8 +501,7 @@ cr.define('oobe', function() {
function() { // When absent.
return true; // Check again after some time.
});
- } else if (imageGrid.selectionType != 'camera' &&
- imageGrid.cameraOnline) {
+ } else {
imageGrid.stopCamera();
}
}
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/user_images_grid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698