| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-camera' is the Polymer control used to take a picture from the | 7 * 'settings-camera' is the Polymer control used to take a picture from the |
| 8 * user webcam to use as a ChromeOS profile picture. | 8 * user webcam to use as a ChromeOS profile picture. |
| 9 */ | 9 */ |
| 10 (function() { | 10 (function() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ], | 26 ], |
| 27 | 27 |
| 28 properties: { | 28 properties: { |
| 29 /** | 29 /** |
| 30 * True if the user has selected the camera as the user image source. | 30 * True if the user has selected the camera as the user image source. |
| 31 * @type {boolean} | 31 * @type {boolean} |
| 32 */ | 32 */ |
| 33 cameraActive: { | 33 cameraActive: { |
| 34 type: Boolean, | 34 type: Boolean, |
| 35 observer: 'cameraActiveChanged_', | 35 observer: 'cameraActiveChanged_', |
| 36 value: false, |
| 36 }, | 37 }, |
| 37 | 38 |
| 38 /** | 39 /** |
| 39 * True when the camera is actually streaming video. May be false even when | 40 * True when the camera is actually streaming video. May be false even when |
| 40 * the camera is present and shown, but still initializing. | 41 * the camera is present and shown, but still initializing. |
| 41 * @private {boolean} | 42 * @private {boolean} |
| 42 */ | 43 */ |
| 43 cameraOnline_: { | 44 cameraOnline_: { |
| 44 type: Boolean, | 45 type: Boolean, |
| 45 value: false, | 46 value: false, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 canvas.height = CAPTURE_SIZE.height; | 204 canvas.height = CAPTURE_SIZE.height; |
| 204 var ctx = canvas.getContext('2d'); | 205 var ctx = canvas.getContext('2d'); |
| 205 ctx.translate(CAPTURE_SIZE.width, 0); | 206 ctx.translate(CAPTURE_SIZE.width, 0); |
| 206 ctx.scale(-1.0, 1.0); | 207 ctx.scale(-1.0, 1.0); |
| 207 ctx.drawImage(source, 0, 0); | 208 ctx.drawImage(source, 0, 0); |
| 208 return canvas.toDataURL('image/png'); | 209 return canvas.toDataURL('image/png'); |
| 209 }, | 210 }, |
| 210 }); | 211 }); |
| 211 | 212 |
| 212 })(); | 213 })(); |
| OLD | NEW |