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

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..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'));
Dan Beam 2016/02/29 19:26:01 nit: don't put spaces between */ and (
tommycli 2016/02/29 20:28:25 Hi. This was the result of git cl format, and seem
+ 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