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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 2142653003: DevTools: move functionality away from ElementsPanel for better DOM tree control reuse. (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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/module.json ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 * @param {string} location 938 * @param {string} location
939 */ 939 */
940 _loadItems: function(location) 940 _loadItems: function(location)
941 { 941 {
942 var extensions = self.runtime.extensions(WebInspector.ToolbarItem.Provid er); 942 var extensions = self.runtime.extensions(WebInspector.ToolbarItem.Provid er);
943 var promises = []; 943 var promises = [];
944 for (var i = 0; i < extensions.length; ++i) { 944 for (var i = 0; i < extensions.length; ++i) {
945 if (extensions[i].descriptor()["location"] === location) 945 if (extensions[i].descriptor()["location"] === location)
946 promises.push(resolveItem(extensions[i])); 946 promises.push(resolveItem(extensions[i]));
947 } 947 }
948 this._promise = Promise.all(promises).then(appendItemsInOrder.bind(this) ); 948 Promise.all(promises).then(appendItemsInOrder.bind(this));
949 949
950 /** 950 /**
951 * @param {!Runtime.Extension} extension 951 * @param {!Runtime.Extension} extension
952 * @return {!Promise.<?WebInspector.ToolbarItem>} 952 * @return {!Promise.<?WebInspector.ToolbarItem>}
953 */ 953 */
954 function resolveItem(extension) 954 function resolveItem(extension)
955 { 955 {
956 var descriptor = extension.descriptor(); 956 var descriptor = extension.descriptor();
957 if (descriptor["separator"]) 957 if (descriptor["separator"])
958 return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */( new WebInspector.ToolbarSeparator())); 958 return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */( new WebInspector.ToolbarSeparator()));
(...skipping 19 matching lines...) Expand all
978 function appendItemsInOrder(items) 978 function appendItemsInOrder(items)
979 { 979 {
980 for (var i = 0; i < items.length; ++i) { 980 for (var i = 0; i < items.length; ++i) {
981 var item = items[i]; 981 var item = items[i];
982 if (item) 982 if (item)
983 this.appendToolbarItem(item); 983 this.appendToolbarItem(item);
984 } 984 }
985 } 985 }
986 }, 986 },
987 987
988 /**
989 * @return {!Promise}
990 */
991 onLoad: function()
992 {
993 return this._promise;
994 },
995
996 __proto__: WebInspector.Toolbar.prototype 988 __proto__: WebInspector.Toolbar.prototype
997 } 989 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/module.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698