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

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

Issue 2141273002: Reland of DevTools: automatically populate 'More tools' submenu with the drawer views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 return WebInspector.Revealer.revealPromise(WebInspector.console); 51 return WebInspector.Revealer.revealPromise(WebInspector.console);
52 }, 52 },
53 53
54 _loaded: function() 54 _loaded: function()
55 { 55 {
56 console.timeStamp("Main._loaded"); 56 console.timeStamp("Main._loaded");
57 57
58 if (InspectorFrontendHost.isUnderTest()) 58 if (InspectorFrontendHost.isUnderTest())
59 self.runtime.useTestBase(); 59 self.runtime.useTestBase();
60 Runtime.setPlatform(WebInspector.platform());
60 InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this)); 61 InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
61 }, 62 },
62 63
63 /** 64 /**
64 * @param {!Object<string, string>} prefs 65 * @param {!Object<string, string>} prefs
65 */ 66 */
66 _gotPreferences: function(prefs) 67 _gotPreferences: function(prefs)
67 { 68 {
68 console.timeStamp("Main._gotPreferences"); 69 console.timeStamp("Main._gotPreferences");
69 this._createSettings(prefs); 70 this._createSettings(prefs);
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 * @param {string} side 877 * @param {string} side
877 */ 878 */
878 function setDockSide(side) 879 function setDockSide(side)
879 { 880 {
880 WebInspector.dockController.setDockSide(side); 881 WebInspector.dockController.setDockSide(side);
881 contextMenu.discard(); 882 contextMenu.discard();
882 } 883 }
883 884
884 contextMenu.appendAction("main.toggle-drawer", WebInspector.inspectorVie w.drawerVisible() ? WebInspector.UIString("Hide console") : WebInspector.UIStrin g("Show console")); 885 contextMenu.appendAction("main.toggle-drawer", WebInspector.inspectorVie w.drawerVisible() ? WebInspector.UIString("Hide console") : WebInspector.UIStrin g("Show console"));
885 contextMenu.appendItemsAtLocation("mainMenu"); 886 contextMenu.appendItemsAtLocation("mainMenu");
887 var moreTools = contextMenu.namedSubMenu("mainMenuMoreTools");
888 var extensions = self.runtime.extensions("drawer-view", undefined, true) ;
889 for (var extension of extensions) {
890 var descriptor = extension.descriptor();
891 moreTools.appendItem(extension.title(), WebInspector.inspectorView.s howViewInDrawer.bind(WebInspector.inspectorView, descriptor["name"]));
892 }
893
886 contextMenu.show(); 894 contextMenu.show();
887 } 895 }
888 } 896 }
889 897
890 /** 898 /**
891 * @constructor 899 * @constructor
892 */ 900 */
893 WebInspector.NetworkPanelIndicator = function() 901 WebInspector.NetworkPanelIndicator = function()
894 { 902 {
895 // TODO: we should not access network from other modules. 903 // TODO: we should not access network from other modules.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 * @return {?Element} 1125 * @return {?Element}
1118 */ 1126 */
1119 settingElement: function() 1127 settingElement: function()
1120 { 1128 {
1121 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1129 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1122 } 1130 }
1123 } 1131 }
1124 1132
1125 1133
1126 new WebInspector.Main(); 1134 new WebInspector.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698