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

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

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 return Promise.all(promises).then(undefined); 758 return Promise.all(promises).then(undefined);
759 } 759 }
760 760
761 /** 761 /**
762 * @return {!Promise.<undefined>} 762 * @return {!Promise.<undefined>}
763 */ 763 */
764 _loadScripts() { 764 _loadScripts() {
765 if (!this._descriptor.scripts || !this._descriptor.scripts.length) 765 if (!this._descriptor.scripts || !this._descriptor.scripts.length)
766 return Promise.resolve(); 766 return Promise.resolve();
767
768 // Module namespaces.
769 var namespace = this._name.replace('_lazy', '');
770 if (namespace === 'sdk' || namespace === 'ui')
771 namespace = namespace.toUpperCase();
772 namespace = namespace.split('_').map(a => a.substring(0, 1).toUpperCase() + a.substring(1)).join('');
773 self[namespace] = self[namespace] || {};
774
767 return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modula rizeURL, this), this._remoteBase()); 775 return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modula rizeURL, this), this._remoteBase());
768 } 776 }
769 777
770 /** 778 /**
771 * @param {string} resourceName 779 * @param {string} resourceName
772 */ 780 */
773 _modularizeURL(resourceName) { 781 _modularizeURL(resourceName) {
774 return Runtime.normalizePath(this._name + '/' + resourceName); 782 return Runtime.normalizePath(this._name + '/' + resourceName);
775 } 783 }
776 784
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 throw new Error('Could not instantiate: ' + className); 883 throw new Error('Could not instantiate: ' + className);
876 if (this._className) 884 if (this._className)
877 return this._module._manager.sharedInstance(constructorFunction); 885 return this._module._manager.sharedInstance(constructorFunction);
878 return new constructorFunction(this); 886 return new constructorFunction(this);
879 } 887 }
880 888
881 /** 889 /**
882 * @return {string} 890 * @return {string}
883 */ 891 */
884 title() { 892 title() {
885 // FIXME: should be WebInspector.UIString() but runtime is not l10n aware ye t. 893 // FIXME: should be Common.UIString() but runtime is not l10n aware yet.
886 return this._descriptor['title-' + Runtime._platform] || this._descriptor['t itle']; 894 return this._descriptor['title-' + Runtime._platform] || this._descriptor['t itle'];
887 } 895 }
888 896
889 /** 897 /**
890 * @param {function(new:Object)} contextType 898 * @param {function(new:Object)} contextType
891 * @return {boolean} 899 * @return {boolean}
892 */ 900 */
893 hasContextType(contextType) { 901 hasContextType(contextType) {
894 var contextTypes = this.descriptor().contextTypes; 902 var contextTypes = this.descriptor().contextTypes;
895 if (!contextTypes) 903 if (!contextTypes)
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 send: function(message) {}, 1112 send: function(message) {},
1105 1113
1106 /** 1114 /**
1107 * @return {!Promise<boolean>} 1115 * @return {!Promise<boolean>}
1108 */ 1116 */
1109 close: function() {} 1117 close: function() {}
1110 }; 1118 };
1111 1119
1112 /** @type {!Runtime} */ 1120 /** @type {!Runtime} */
1113 var runtime; 1121 var runtime;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/Tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698