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

Side by Side Diff: chrome/browser/resources/md_downloads/crisper.js

Issue 2346073003: [Polymer] updating (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | chrome/browser/resources/md_downloads/vulcanized.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 function assert(condition, opt_message) { 4 function assert(condition, opt_message) {
5 if (!condition) { 5 if (!condition) {
6 var message = 'Assertion failed'; 6 var message = 'Assertion failed';
7 if (opt_message) message = message + ': ' + opt_message; 7 if (opt_message) message = message + ': ' + opt_message;
8 var error = new Error(message); 8 var error = new Error(message);
9 var global = function() { 9 var global = function() {
10 return this; 10 return this;
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 validKey = String(keyCode - 48); 1058 validKey = String(keyCode - 48);
1059 } else if (keyCode >= 96 && keyCode <= 105) { 1059 } else if (keyCode >= 96 && keyCode <= 105) {
1060 validKey = String(keyCode - 96); 1060 validKey = String(keyCode - 96);
1061 } else { 1061 } else {
1062 validKey = KEY_CODE[keyCode]; 1062 validKey = KEY_CODE[keyCode];
1063 } 1063 }
1064 } 1064 }
1065 return validKey; 1065 return validKey;
1066 } 1066 }
1067 function normalizedKeyForEvent(keyEvent, noSpecialChars) { 1067 function normalizedKeyForEvent(keyEvent, noSpecialChars) {
1068 return transformKey(keyEvent.key, noSpecialChars) || transformKeyIdentifier( keyEvent.keyIdentifier) || transformKeyCode(keyEvent.keyCode) || transformKey(ke yEvent.detail ? keyEvent.detail.key : keyEvent.detail, noSpecialChars) || ''; 1068 if (keyEvent.key) {
1069 return transformKey(keyEvent.key, noSpecialChars);
1070 }
1071 if (keyEvent.detail && keyEvent.detail.key) {
1072 return transformKey(keyEvent.detail.key, noSpecialChars);
1073 }
1074 return transformKeyIdentifier(keyEvent.keyIdentifier) || transformKeyCode(ke yEvent.keyCode) || '';
1069 } 1075 }
1070 function keyComboMatchesEvent(keyCombo, event) { 1076 function keyComboMatchesEvent(keyCombo, event) {
1071 var keyEvent = normalizedKeyForEvent(event, keyCombo.hasModifiers); 1077 var keyEvent = normalizedKeyForEvent(event, keyCombo.hasModifiers);
1072 return keyEvent === keyCombo.key && (!keyCombo.hasModifiers || !!event.shift Key === !!keyCombo.shiftKey && !!event.ctrlKey === !!keyCombo.ctrlKey && !!event .altKey === !!keyCombo.altKey && !!event.metaKey === !!keyCombo.metaKey); 1078 return keyEvent === keyCombo.key && (!keyCombo.hasModifiers || !!event.shift Key === !!keyCombo.shiftKey && !!event.ctrlKey === !!keyCombo.ctrlKey && !!event .altKey === !!keyCombo.altKey && !!event.metaKey === !!keyCombo.metaKey);
1073 } 1079 }
1074 function parseKeyComboString(keyComboString) { 1080 function parseKeyComboString(keyComboString) {
1075 if (keyComboString.length === 1) { 1081 if (keyComboString.length === 1) {
1076 return { 1082 return {
1077 combo: keyComboString, 1083 combo: keyComboString,
1078 key: keyComboString, 1084 key: keyComboString,
(...skipping 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after
6984 }; 6990 };
6985 return { 6991 return {
6986 Manager: Manager 6992 Manager: Manager
6987 }; 6993 };
6988 }); 6994 });
6989 6995
6990 // Copyright 2015 The Chromium Authors. All rights reserved. 6996 // Copyright 2015 The Chromium Authors. All rights reserved.
6991 // Use of this source code is governed by a BSD-style license that can be 6997 // Use of this source code is governed by a BSD-style license that can be
6992 // found in the LICENSE file. 6998 // found in the LICENSE file.
6993 window.addEventListener('load', downloads.Manager.onLoad); 6999 window.addEventListener('load', downloads.Manager.onLoad);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/vulcanized.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698