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

Unified Diff: chrome/browser/resources/chromeos/user_images_grid.js

Issue 395133002: Clean up. Experimental user avatars removed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Libvpx update. Created 6 years, 5 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 | « DEPS ('k') | chrome/browser/ui/webui/options/chromeos/user_image_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/user_images_grid.js
diff --git a/chrome/browser/resources/chromeos/user_images_grid.js b/chrome/browser/resources/chromeos/user_images_grid.js
index b64b7aedab955ec1ab5f46b41ea1683293ee2f24..3aa9bb9d9ffc9fc020f81cc798be24ba22867c4f 100644
--- a/chrome/browser/resources/chromeos/user_images_grid.js
+++ b/chrome/browser/resources/chromeos/user_images_grid.js
@@ -9,18 +9,6 @@ cr.define('options', function() {
/** @const */ var GridSelectionController = cr.ui.GridSelectionController;
/** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
- /**
- * Number of frames recorded by takeVideo().
- * @const
- */
- var RECORD_FRAMES = 48;
-
- /**
- * FPS at which camera stream is recorded.
- * @const
- */
- var RECORD_FPS = 16;
-
/**
* Dimensions for camera capture.
* @const
@@ -316,7 +304,7 @@ cr.define('options', function() {
document.activeElement.tagName == 'BODY') {
$('user-image-grid').focus();
}
- }
+ };
// Timeout guarantees processing AFTER style changes display attribute.
setTimeout(setFocusIfLost, 0);
},
@@ -491,29 +479,6 @@ cr.define('options', function() {
},
/**
- * Performs video capture from the live camera stream.
- * @param {function=} opt_callback Callback that receives taken video as
- * data URL of a vertically stacked PNG sprite.
- */
- takeVideo: function(opt_callback) {
- var canvas = document.createElement('canvas');
- canvas.width = CAPTURE_SIZE.width;
- canvas.height = CAPTURE_SIZE.height * RECORD_FRAMES;
- var ctx = canvas.getContext('2d');
- // Force canvas initialization to prevent FPS lag on the first frame.
- ctx.fillRect(0, 0, 1, 1);
- var captureData = {
- callback: opt_callback,
- canvas: canvas,
- ctx: ctx,
- frameNo: 0,
- lastTimestamp: new Date().getTime()
- };
- captureData.timer = window.setInterval(
- this.captureVideoFrame_.bind(this, captureData), 1000 / RECORD_FPS);
- },
-
- /**
* Discard current photo and return to the live camera stream.
*/
discardPhoto: function() {
@@ -570,27 +535,6 @@ cr.define('options', function() {
},
/**
- * Capture next frame of the video being recorded after a takeVideo() call.
- * @param {Object} data Property bag with the recorder details.
- * @private
- */
- captureVideoFrame_: function(data) {
- var lastTimestamp = new Date().getTime();
- var delayMs = lastTimestamp - data.lastTimestamp;
- console.error('Delay: ' + delayMs + ' (' + (1000 / delayMs + ' FPS)'));
- data.lastTimestamp = lastTimestamp;
-
- this.captureFrame_(this.cameraVideo_, data.ctx, CAPTURE_SIZE);
- data.ctx.translate(0, CAPTURE_SIZE.height);
-
- if (++data.frameNo == RECORD_FRAMES) {
- window.clearTimeout(data.timer);
- if (data.callback && typeof data.callback == 'function')
- data.callback(data.canvas.toDataURL('image/png'));
- }
- },
-
- /**
* Adds new image to the user image grid.
* @param {string} src Image URL.
* @param {string=} opt_title Image tooltip.
« no previous file with comments | « DEPS ('k') | chrome/browser/ui/webui/options/chromeos/user_image_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698