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

Side by Side Diff: chrome/test/data/webrtc/manual/peerconnection_manual.js

Issue 384353002: Removed spaces, fixed local storage mechanism for first time visit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/webrtc/manual/peerconnection.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more 8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more
9 * information on getUserMedia. See 9 * information on getUserMedia. See
10 * http://dev.w3.org/2011/webrtc/editor/webrtc.html for more information on 10 * http://dev.w3.org/2011/webrtc/editor/webrtc.html for more information on
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 * @param {!string} element_id to be used as a key for local storage and the id 1055 * @param {!string} element_id to be used as a key for local storage and the id
1056 * of the element to store the state for. 1056 * of the element to store the state for.
1057 */ 1057 */
1058 function registerLocalStorage_(element_id) { 1058 function registerLocalStorage_(element_id) {
1059 var element = $(element_id); 1059 var element = $(element_id);
1060 if (element.tagName != 'INPUT') { 1060 if (element.tagName != 'INPUT') {
1061 error_('You can only use registerLocalStorage_ for input elements. ' + 1061 error_('You can only use registerLocalStorage_ for input elements. ' +
1062 'Element \"' + element.tagName + '\" is not an input element. '); 1062 'Element \"' + element.tagName + '\" is not an input element. ');
1063 } 1063 }
1064 1064
1065 if (localStorage.getItem(element.id) == 'undefined') { 1065 if (localStorage.getItem(element.id) == null) {
1066 storeLocalStorageField_(element); 1066 storeLocalStorageField_(element);
1067 } else { 1067 } else {
1068 getLocalStorageField_(element); 1068 getLocalStorageField_(element);
1069 } 1069 }
1070
1070 // Registers the appropriate events for input elements. 1071 // Registers the appropriate events for input elements.
1071 if (element.type == 'checkbox') { 1072 if (element.type == 'checkbox') {
1072 element.onclick = function() { storeLocalStorageField_(this); }; 1073 element.onclick = function() { storeLocalStorageField_(this); };
1073 } else if (element.type == 'text') { 1074 } else if (element.type == 'text') {
1074 element.onblur = function() { storeLocalStorageField_(this); }; 1075 element.onblur = function() { storeLocalStorageField_(this); };
1075 } else { 1076 } else {
1076 error_('Unsupportered input type: ' + '\"' + element.type + '\"'); 1077 error_('Unsupportered input type: ' + '\"' + element.type + '\"');
1077 } 1078 }
1078 } 1079 }
1079 1080
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 1391
1391 /** @private */ 1392 /** @private */
1392 function readResponseHeader_(request, key) { 1393 function readResponseHeader_(request, key) {
1393 var value = request.getResponseHeader(key); 1394 var value = request.getResponseHeader(key);
1394 if (value == null || value.length == 0) { 1395 if (value == null || value.length == 0) {
1395 error_('Received empty value ' + value + 1396 error_('Received empty value ' + value +
1396 ' for response header key ' + key + '.'); 1397 ' for response header key ' + key + '.');
1397 } 1398 }
1398 return parseInt(value); 1399 return parseInt(value);
1399 } 1400 }
OLDNEW
« no previous file with comments | « chrome/test/data/webrtc/manual/peerconnection.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698