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

Unified Diff: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js

Issue 2080173003: DevTools: pass theme name to the extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test rebaselined 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
index 3f8150ea4327e8378227213a5ba576985c74c7a9..64f379bb12332861b2cfe7d8d7867cfc22f79794 100644
--- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
+++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
@@ -978,6 +978,7 @@ function platformExtensionAPI(coreAPI)
chrome.devtools.inspectedWindow.__proto__ = coreAPI.inspectedWindow;
chrome.devtools.network = coreAPI.network;
chrome.devtools.panels = coreAPI.panels;
+ chrome.devtools.panels.themeName = themeName;
// default to expose experimental APIs for now.
if (extensionInfo.exposeExperimentalAPIs !== false) {
@@ -998,27 +999,30 @@ function platformExtensionAPI(coreAPI)
/**
* @param {!ExtensionDescriptor} extensionInfo
* @param {string} inspectedTabId
+ * @param {string} themeName
* @return {string}
*/
-function buildPlatformExtensionAPI(extensionInfo, inspectedTabId)
+function buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName)
{
return "var extensionInfo = " + JSON.stringify(extensionInfo) + ";" +
"var tabId = " + inspectedTabId + ";" +
+ "var themeName = '" + themeName + "';" +
platformExtensionAPI.toString();
}
/**
* @param {!ExtensionDescriptor} extensionInfo
* @param {string} inspectedTabId
+ * @param {string} themeName
* @return {string}
*/
-function buildExtensionAPIInjectedScript(extensionInfo, inspectedTabId)
+function buildExtensionAPIInjectedScript(extensionInfo, inspectedTabId, themeName)
{
return "(function(injectedScriptId){ " +
"var extensionServer;" +
defineCommonExtensionSymbols.toString() + ";" +
injectedExtensionAPI.toString() + ";" +
- buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" +
+ buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName) + ";" +
"platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" +
"return {};" +
"})";

Powered by Google App Engine
This is Rietveld 408576698