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

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

Issue 2080173003: DevTools: pass theme name to the extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 try { 758 try {
759 var originMatch = urlOriginRegExp.exec(startPage); 759 var originMatch = urlOriginRegExp.exec(startPage);
760 if (!originMatch) { 760 if (!originMatch) {
761 console.error("Skipping extension with invalid URL: " + startPag e); 761 console.error("Skipping extension with invalid URL: " + startPag e);
762 return false; 762 return false;
763 } 763 }
764 var extensionOrigin = originMatch[1]; 764 var extensionOrigin = originMatch[1];
765 if (!this._registeredExtensions[extensionOrigin]) { 765 if (!this._registeredExtensions[extensionOrigin]) {
766 // See ExtensionAPI.js for details. 766 // See ExtensionAPI.js for details.
767 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin , buildExtensionAPIInjectedScript(extensionInfo, this._inspectedTabId)); 767 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin , buildExtensionAPIInjectedScript(extensionInfo, this._inspectedTabId, WebInspec tor.themeSupport.themeName()));
768 this._registeredExtensions[extensionOrigin] = { name: name }; 768 this._registeredExtensions[extensionOrigin] = { name: name };
769 } 769 }
770 var iframe = createElement("iframe"); 770 var iframe = createElement("iframe");
771 iframe.src = startPage; 771 iframe.src = startPage;
772 iframe.style.display = "none"; 772 iframe.style.display = "none";
773 document.body.appendChild(iframe); // Only for main window. 773 document.body.appendChild(iframe); // Only for main window.
774 } catch (e) { 774 } catch (e) {
775 console.error("Failed to initialize extension " + startPage + ":" + e); 775 console.error("Failed to initialize extension " + startPage + ":" + e);
776 return false; 776 return false;
777 } 777 }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 /** 1071 /**
1072 * @typedef {{code: string, description: string, details: !Array.<*>}} 1072 * @typedef {{code: string, description: string, details: !Array.<*>}}
1073 */ 1073 */
1074 WebInspector.ExtensionStatus.Record; 1074 WebInspector.ExtensionStatus.Record;
1075 1075
1076 WebInspector.extensionAPI = {}; 1076 WebInspector.extensionAPI = {};
1077 defineCommonExtensionSymbols(WebInspector.extensionAPI); 1077 defineCommonExtensionSymbols(WebInspector.extensionAPI);
1078 1078
1079 /** @type {!WebInspector.ExtensionServer} */ 1079 /** @type {!WebInspector.ExtensionServer} */
1080 WebInspector.extensionServer; 1080 WebInspector.extensionServer;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698