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

Unified Diff: chrome/browser/resources/settings/people_page/camera.js

Issue 1720533002: Settings People Revamp: Change Picture: Add accessibility-key usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0095-settings-change-picture-announce-messags-old-image-alt-text
Patch Set: Created 4 years, 10 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
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..c0289385d3077a10021cc2c75408a9f4e724f005 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() {
tommycli 2016/02/19 23:59:01 Code is same, just made public and moved to public
+ 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.

Powered by Google App Engine
This is Rietveld 408576698