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

Side by Side Diff: Source/devtools/front_end/ui/KeyboardShortcut.js

Issue 1295523003: DevTools: do not use arrow functions unless they are in stable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 WebInspector.KeyboardShortcut._modifiersToString = function(modifiers) 285 WebInspector.KeyboardShortcut._modifiersToString = function(modifiers)
286 { 286 {
287 var isMac = WebInspector.isMac(); 287 var isMac = WebInspector.isMac();
288 var m = WebInspector.KeyboardShortcut.Modifiers; 288 var m = WebInspector.KeyboardShortcut.Modifiers;
289 var modifierNames = new Map([ 289 var modifierNames = new Map([
290 [m.Ctrl, isMac ? "\u2303" : "Ctrl\u200A+\u200A"], 290 [m.Ctrl, isMac ? "\u2303" : "Ctrl\u200A+\u200A"],
291 [m.Alt, isMac ? "\u2325" : "Alt\u200A+\u200A"], 291 [m.Alt, isMac ? "\u2325" : "Alt\u200A+\u200A"],
292 [m.Shift, isMac ? "\u21e7" : "Shift\u200A+\u200A"], 292 [m.Shift, isMac ? "\u21e7" : "Shift\u200A+\u200A"],
293 [m.Meta, isMac ? "\u2318" : "Win\u200A+\u200A"] 293 [m.Meta, isMac ? "\u2318" : "Win\u200A+\u200A"]
294 ]); 294 ]);
295 return [m.Ctrl, m.Alt, m.Shift, m.Meta].map(m => modifiers & m ? modifierNam es.get(m) : "").join(""); 295 return [m.Ctrl, m.Alt, m.Shift, m.Meta].map(mapModifiers).join("");
296
297 /**
298 * @param {number} m
299 * @return {string}
300 */
301 function mapModifiers(m)
302 {
303 return modifiers & m ? /** @type {string} */ (modifierNames.get(m)) : "" ;
304 }
296 }; 305 };
297 306
298 WebInspector.KeyboardShortcut.SelectAll = WebInspector.KeyboardShortcut.makeKey( "a", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); 307 WebInspector.KeyboardShortcut.SelectAll = WebInspector.KeyboardShortcut.makeKey( "a", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);
OLDNEW
« no previous file with comments | « Source/devtools/front_end/network/NetworkPanel.js ('k') | Source/devtools/front_end/ui_lazy/TimelineOverviewPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698