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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: made layers panel closeable. Created 4 years, 2 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) 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 return; 474 return;
475 475
476 var document = event.target && event.target.ownerDocument; 476 var document = event.target && event.target.ownerDocument;
477 var target = document ? document.deepActiveElement() : null; 477 var target = document ? document.deepActiveElement() : null;
478 if (target) { 478 if (target) {
479 var anchor = target.enclosingNodeOrSelfWithNodeName("a"); 479 var anchor = target.enclosingNodeOrSelfWithNodeName("a");
480 if (anchor && anchor.preventFollow) 480 if (anchor && anchor.preventFollow)
481 event.preventDefault(); 481 event.preventDefault();
482 } 482 }
483 483
484 if (!WebInspector.Dialog.hasInstance() && WebInspector.inspectorView.cur rentPanel()) { 484 if (!WebInspector.Dialog.hasInstance() && WebInspector.inspectorView.cur rentPanelDeprecated()) {
485 WebInspector.inspectorView.currentPanel().handleShortcut(event); 485 WebInspector.inspectorView.currentPanelDeprecated().handleShortcut(e vent);
486 if (event.handled) { 486 if (event.handled) {
487 event.consume(true); 487 event.consume(true);
488 return; 488 return;
489 } 489 }
490 } 490 }
491 491
492 WebInspector.shortcutRegistry.handleShortcut(event); 492 WebInspector.shortcutRegistry.handleShortcut(event);
493 }, 493 },
494 494
495 /** 495 /**
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 WebInspector.Main.SearchActionDelegate.prototype = { 668 WebInspector.Main.SearchActionDelegate.prototype = {
669 /** 669 /**
670 * @override 670 * @override
671 * @param {!WebInspector.Context} context 671 * @param {!WebInspector.Context} context
672 * @param {string} actionId 672 * @param {string} actionId
673 * @return {boolean} 673 * @return {boolean}
674 * @suppressGlobalPropertiesCheck 674 * @suppressGlobalPropertiesCheck
675 */ 675 */
676 handleAction: function(context, actionId) 676 handleAction: function(context, actionId)
677 { 677 {
678 var searchableView = WebInspector.SearchableView.fromElement(document.de epActiveElement()) || WebInspector.inspectorView.currentPanel().searchableView() ; 678 var searchableView = WebInspector.SearchableView.fromElement(document.de epActiveElement()) || WebInspector.inspectorView.currentPanelDeprecated().search ableView();
679 if (!searchableView) 679 if (!searchableView)
680 return false; 680 return false;
681 switch (actionId) { 681 switch (actionId) {
682 case "main.search-in-panel.find": 682 case "main.search-in-panel.find":
683 return searchableView.handleFindShortcut(); 683 return searchableView.handleFindShortcut();
684 case "main.search-in-panel.cancel": 684 case "main.search-in-panel.cancel":
685 return searchableView.handleCancelSearchShortcut(); 685 return searchableView.handleCancelSearchShortcut();
686 case "main.search-in-panel.find-next": 686 case "main.search-in-panel.find-next":
687 return searchableView.handleFindNextShortcut(); 687 return searchableView.handleFindNextShortcut();
688 case "main.search-in-panel.find-previous": 688 case "main.search-in-panel.find-previous":
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 WebInspector.dockController.setDockSide(side); 851 WebInspector.dockController.setDockSide(side);
852 contextMenu.discard(); 852 contextMenu.discard();
853 } 853 }
854 854
855 contextMenu.appendAction("main.toggle-drawer", WebInspector.inspectorVie w.drawerVisible() ? WebInspector.UIString("Hide console drawer") : WebInspector. UIString("Show console drawer")); 855 contextMenu.appendAction("main.toggle-drawer", WebInspector.inspectorVie w.drawerVisible() ? WebInspector.UIString("Hide console drawer") : WebInspector. UIString("Show console drawer"));
856 contextMenu.appendItemsAtLocation("mainMenu"); 856 contextMenu.appendItemsAtLocation("mainMenu");
857 var moreTools = contextMenu.namedSubMenu("mainMenuMoreTools"); 857 var moreTools = contextMenu.namedSubMenu("mainMenuMoreTools");
858 var extensions = self.runtime.extensions("view", undefined, true); 858 var extensions = self.runtime.extensions("view", undefined, true);
859 for (var extension of extensions) { 859 for (var extension of extensions) {
860 var descriptor = extension.descriptor(); 860 var descriptor = extension.descriptor();
861 if (descriptor["location"] !== "drawer-view") 861 if (descriptor["persistence"] !== "closeable")
862 continue;
863 if (descriptor["location"] !== "drawer-view" && descriptor["location "] !== "panel")
862 continue; 864 continue;
863 moreTools.appendItem(extension.title(), WebInspector.viewManager.sho wView.bind(WebInspector.viewManager, descriptor["id"])); 865 moreTools.appendItem(extension.title(), WebInspector.viewManager.sho wView.bind(WebInspector.viewManager, descriptor["id"]));
864 } 866 }
865 867
866 contextMenu.show(); 868 contextMenu.show();
867 } 869 }
868 } 870 }
869 871
870 /** 872 /**
871 * @constructor 873 * @constructor
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 * @override 1117 * @override
1116 * @return {?Element} 1118 * @return {?Element}
1117 */ 1119 */
1118 settingElement: function() 1120 settingElement: function()
1119 { 1121 {
1120 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1122 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1121 } 1123 }
1122 } 1124 }
1123 1125
1124 new WebInspector.Main(); 1126 new WebInspector.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698