| Index: chrome/browser/resources/settings/people_page/camera.js
|
| diff --git a/chrome/browser/resources/settings/people_page/camera.js b/chrome/browser/resources/settings/people_page/camera.js
|
| index b403884d4a638a823c3cefbffbf9fcf1b4e0ae86..5bfa158a45f3f9d53c4d7558c8d64c3a4c0b0aa6 100644
|
| --- a/chrome/browser/resources/settings/people_page/camera.js
|
| +++ b/chrome/browser/resources/settings/people_page/camera.js
|
| @@ -66,6 +66,31 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * Performs photo capture from the live camera stream. 'phototaken' event
|
| + * will be fired as soon as captured photo is available, with 'dataURL'
|
| + * property containing the photo encoded as a data URL.
|
| + * @private
|
| + */
|
| + takePhoto: function() {
|
| + if (!this.cameraOnline_)
|
| + return;
|
| + var canvas =
|
| + /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
| + canvas.width = CAPTURE_SIZE.width;
|
| + canvas.height = CAPTURE_SIZE.height;
|
| + this.captureFrame_(
|
| + this.$.cameraVideo,
|
| + /** @type {!CanvasRenderingContext2D} */ (canvas.getContext('2d')));
|
| +
|
| + var photoDataUrl = this.isFlipped_ ? this.flipFrame_(canvas) :
|
| + canvas.toDataURL('image/png');
|
| + this.fire('phototaken', {photoDataUrl: photoDataUrl});
|
| +
|
| + announceAccessibleMessage(
|
| + loadTimeData.getString('photoCaptureAccessibleText'));
|
| + },
|
| +
|
| + /**
|
| * Observer for the cameraActive property.
|
| * @private
|
| */
|
| @@ -140,31 +165,6 @@ Polymer({
|
| },
|
|
|
| /**
|
| - * Performs photo capture from the live camera stream. 'phototaken' event
|
| - * will be fired as soon as captured photo is available, with 'dataURL'
|
| - * property containing the photo encoded as a data URL.
|
| - * @private
|
| - */
|
| - onTapTakePhoto_: function() {
|
| - if (!this.cameraOnline_)
|
| - return;
|
| - var canvas = /** @type {HTMLCanvasElement} */(
|
| - document.createElement('canvas'));
|
| - canvas.width = CAPTURE_SIZE.width;
|
| - canvas.height = CAPTURE_SIZE.height;
|
| - this.captureFrame_(
|
| - this.$.cameraVideo,
|
| - /** @type {!CanvasRenderingContext2D} */(canvas.getContext('2d')));
|
| -
|
| - var photoDataUrl = this.isFlipped_ ? this.flipFrame_(canvas) :
|
| - canvas.toDataURL('image/png');
|
| - this.fire('phototaken', {photoDataUrl: photoDataUrl});
|
| -
|
| - announceAccessibleMessage(
|
| - loadTimeData.getString('photoCaptureAccessibleText'));
|
| - },
|
| -
|
| - /**
|
| * Captures a single still frame from a <video> element, placing it at the
|
| * current drawing origin of a canvas context.
|
| * @param {!HTMLVideoElement} video Video element to capture from.
|
|
|