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

Side by Side Diff: Source/WebCore/inspector/front-end/inspector.js

Issue 11413082: Merge 134944 - Web Inspector: Workaround to show shortcuts for panels that hasn't been loaded. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month 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 | « Source/WebCore/inspector/front-end/ShortcutsScreen.js ('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 (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 ProfilerAgent.hasHeapProfiler(WebInspector._initializeCapability.bind(WebIns pector, "heapProfilerPresent", null)); 370 ProfilerAgent.hasHeapProfiler(WebInspector._initializeCapability.bind(WebIns pector, "heapProfilerPresent", null));
371 TimelineAgent.supportsFrameInstrumentation(WebInspector._initializeCapabilit y.bind(WebInspector, "timelineSupportsFrameInstrumentation", null)); 371 TimelineAgent.supportsFrameInstrumentation(WebInspector._initializeCapabilit y.bind(WebInspector, "timelineSupportsFrameInstrumentation", null));
372 TimelineAgent.canMonitorMainThread(WebInspector._initializeCapability.bind(W ebInspector, "timelineCanMonitorMainThread", null)); 372 TimelineAgent.canMonitorMainThread(WebInspector._initializeCapability.bind(W ebInspector, "timelineCanMonitorMainThread", null));
373 PageAgent.canOverrideDeviceMetrics(WebInspector._initializeCapability.bind(W ebInspector, "canOverrideDeviceMetrics", null)); 373 PageAgent.canOverrideDeviceMetrics(WebInspector._initializeCapability.bind(W ebInspector, "canOverrideDeviceMetrics", null));
374 PageAgent.canOverrideGeolocation(WebInspector._initializeCapability.bind(Web Inspector, "canOverrideGeolocation", null)); 374 PageAgent.canOverrideGeolocation(WebInspector._initializeCapability.bind(Web Inspector, "canOverrideGeolocation", null));
375 PageAgent.canOverrideDeviceOrientation(WebInspector._initializeCapability.bi nd(WebInspector, "canOverrideDeviceOrientation", WebInspector._doLoadedDoneWithC apabilities.bind(WebInspector))); 375 PageAgent.canOverrideDeviceOrientation(WebInspector._initializeCapability.bi nd(WebInspector, "canOverrideDeviceOrientation", WebInspector._doLoadedDoneWithC apabilities.bind(WebInspector)));
376 } 376 }
377 377
378 WebInspector._doLoadedDoneWithCapabilities = function() 378 WebInspector._doLoadedDoneWithCapabilities = function()
379 { 379 {
380 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); 380 var panelDescriptors = this._panelDescriptors();
381 this._registerShortcuts(); 381 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(this._regist erShortcuts.bind(this, panelDescriptors));
382 382
383 // set order of some sections explicitly 383 // set order of some sections explicitly
384 WebInspector.shortcutsScreen.section(WebInspector.UIString("All Panels"));
384 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console")); 385 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console"));
385 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel") ); 386 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel") );
386 387
387 this.console = new WebInspector.ConsoleModel(); 388 this.console = new WebInspector.ConsoleModel();
388 this.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleare d, this._updateErrorAndWarningCounts, this); 389 this.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleare d, this._updateErrorAndWarningCounts, this);
389 this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this); 390 this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
390 this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUp dated, this._updateErrorAndWarningCounts, this); 391 this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUp dated, this._updateErrorAndWarningCounts, this);
391 392
392 WebInspector.CSSCompletions.requestCSSNameCompletions(); 393 WebInspector.CSSCompletions.requestCSSNameCompletions();
393 394
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 new WebInspector.StylesSourceMapping(this.workspace); 439 new WebInspector.StylesSourceMapping(this.workspace);
439 if (WebInspector.experimentsSettings.sass.isEnabled()) 440 if (WebInspector.experimentsSettings.sass.isEnabled())
440 new WebInspector.SASSSourceMapping(this.workspace, this.networkWorkspace Provider); 441 new WebInspector.SASSSourceMapping(this.workspace, this.networkWorkspace Provider);
441 442
442 new WebInspector.PresentationConsoleMessageHelper(this.workspace); 443 new WebInspector.PresentationConsoleMessageHelper(this.workspace);
443 444
444 this._createGlobalStatusBarItems(); 445 this._createGlobalStatusBarItems();
445 446
446 this.toolbar = new WebInspector.Toolbar(); 447 this.toolbar = new WebInspector.Toolbar();
447 WebInspector.startBatchUpdate(); 448 WebInspector.startBatchUpdate();
448 var panelDescriptors = this._panelDescriptors();
449 for (var i = 0; i < panelDescriptors.length; ++i) 449 for (var i = 0; i < panelDescriptors.length; ++i)
450 WebInspector.inspectorView.addPanel(panelDescriptors[i]); 450 WebInspector.inspectorView.addPanel(panelDescriptors[i]);
451 WebInspector.endBatchUpdate(); 451 WebInspector.endBatchUpdate();
452 452
453 this.addMainEventListeners(document); 453 this.addMainEventListeners(document);
454 WebInspector.registerLinkifierPlugin(this._profilesLinkifier.bind(this)); 454 WebInspector.registerLinkifierPlugin(this._profilesLinkifier.bind(this));
455 455
456 window.addEventListener("resize", this.windowResize.bind(this), true); 456 window.addEventListener("resize", this.windowResize.bind(this), true);
457 457
458 var errorWarningCount = document.getElementById("error-warning-count"); 458 var errorWarningCount = document.getElementById("error-warning-count");
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 606
607 WebInspector.openResource = function(resourceURL, inResourcesPanel) 607 WebInspector.openResource = function(resourceURL, inResourcesPanel)
608 { 608 {
609 var resource = WebInspector.resourceForURL(resourceURL); 609 var resource = WebInspector.resourceForURL(resourceURL);
610 if (inResourcesPanel && resource) 610 if (inResourcesPanel && resource)
611 WebInspector.showPanel("resources").showResource(resource); 611 WebInspector.showPanel("resources").showResource(resource);
612 else 612 else
613 InspectorFrontendHost.openInNewTab(resourceURL); 613 InspectorFrontendHost.openInNewTab(resourceURL);
614 } 614 }
615 615
616 WebInspector._registerShortcuts = function() 616 WebInspector._registerShortcuts = function(panelDescriptors)
617 { 617 {
618 var shortcut = WebInspector.KeyboardShortcut; 618 var shortcut = WebInspector.KeyboardShortcut;
619 var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Al l Panels")); 619 var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Al l Panels"));
620 var keys = [ 620 var keys = [
621 shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta), 621 shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta),
622 shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta) 622 shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta)
623 ]; 623 ];
624 section.addRelatedKeys(keys, WebInspector.UIString("Go to the panel to the l eft/right")); 624 section.addRelatedKeys(keys, WebInspector.UIString("Go to the panel to the l eft/right"));
625 625
626 var keys = [ 626 var keys = [
(...skipping 14 matching lines...) Expand all
641 if (WebInspector.isMac()) { 641 if (WebInspector.isMac()) {
642 keys = [ 642 keys = [
643 shortcut.shortcutToString("g", shortcut.Modifiers.Meta), 643 shortcut.shortcutToString("g", shortcut.Modifiers.Meta),
644 shortcut.shortcutToString("g", shortcut.Modifiers.Meta | shortcut.Mo difiers.Shift) 644 shortcut.shortcutToString("g", shortcut.Modifiers.Meta | shortcut.Mo difiers.Shift)
645 ]; 645 ];
646 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previous") ); 646 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previous") );
647 } 647 }
648 648
649 var goToShortcut = WebInspector.GoToLineDialog.createShortcut(); 649 var goToShortcut = WebInspector.GoToLineDialog.createShortcut();
650 section.addKey(goToShortcut.name, WebInspector.UIString("Go to line")); 650 section.addKey(goToShortcut.name, WebInspector.UIString("Go to line"));
651
652 for (var i = 0; i < panelDescriptors.length; ++i)
653 panelDescriptors[i].panel();
651 } 654 }
652 655
653 WebInspector.documentKeyDown = function(event) 656 WebInspector.documentKeyDown = function(event)
654 { 657 {
655 const helpKey = WebInspector.isMac() ? "U+003F" : "U+00BF"; // "?" for both platforms 658 const helpKey = WebInspector.isMac() ? "U+003F" : "U+00BF"; // "?" for both platforms
656 659
657 if (event.keyIdentifier === "F1" || 660 if (event.keyIdentifier === "F1" ||
658 (event.keyIdentifier === helpKey && event.shiftKey && (!WebInspector.isB eingEdited(event.target) || event.metaKey))) { 661 (event.keyIdentifier === helpKey && event.shiftKey && (!WebInspector.isB eingEdited(event.target) || event.metaKey))) {
659 this.settingsController.showSettingsScreen(WebInspector.SettingsScreen.T abs.Shortcuts); 662 this.settingsController.showSettingsScreen(WebInspector.SettingsScreen.T abs.Shortcuts);
660 event.consume(true); 663 event.consume(true);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t rue); 973 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t rue);
971 doc.addEventListener("click", this.documentClick.bind(this), true); 974 doc.addEventListener("click", this.documentClick.bind(this), true);
972 } 975 }
973 976
974 WebInspector.ProfileURLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/; 977 WebInspector.ProfileURLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
975 978
976 WebInspector.Zoom = { 979 WebInspector.Zoom = {
977 Table: [0.25, 0.33, 0.5, 0.66, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3 , 4, 5], 980 Table: [0.25, 0.33, 0.5, 0.66, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3 , 4, 5],
978 DefaultOffset: 6 981 DefaultOffset: 6
979 } 982 }
OLDNEW
« no previous file with comments | « Source/WebCore/inspector/front-end/ShortcutsScreen.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698