Chromium Code Reviews| 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 850fb24d9c3f1737340aa37303ce23587c604a98..d1b670ad526f577e9b2a117011bb96238dba9633 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js |
| @@ -81,7 +81,6 @@ function defineCommonExtensionSymbols(apiPrivate) |
| SetOpenResourceHandler: "setOpenResourceHandler", |
| SetResourceContent: "setResourceContent", |
| SetSidebarContent: "setSidebarContent", |
| - SetSidebarHeight: "setSidebarHeight", |
| SetSidebarPage: "setSidebarPage", |
| ShowPanel: "showPanel", |
| StopAuditCategoryRun: "stopAuditCategoryRun", |
| @@ -388,6 +387,20 @@ function defineDeprecatedProperty(object, className, oldName, newName) |
| object.__defineGetter__(oldName, getter); |
| } |
| +function defineDeprecatedMethod(object, className, oldName) |
| +{ |
| + var warningGiven = false; |
| + function noop() |
| + { |
| + if (!warningGiven) { |
|
caseq
2016/04/20 18:17:12
nit:
if (warningGiven)
return;
(we prefer ear
|
| + console.warn(className + "." + oldName + " is deprecated, please don't use it. It is a no-op."); |
| + warningGiven = true; |
| + } |
| + return null; |
|
caseq
2016/04/20 18:17:12
drop return altogether?
|
| + } |
| + object.oldName = noop.bind(null); |
|
caseq
2016/04/20 18:17:12
Hmm... Does this work?
|
| +} |
| + |
| function extractCallbackArgument(args) |
| { |
| var lastArgument = args[args.length - 1]; |
| @@ -481,14 +494,10 @@ ExtensionPanelImpl.prototype = { |
| function ExtensionSidebarPaneImpl(id) |
| { |
| ExtensionViewImpl.call(this, id); |
| + defineDeprecatedMethod(this, "ExtensionSidebarPane", "setHeight"); |
| } |
| ExtensionSidebarPaneImpl.prototype = { |
| - setHeight: function(height) |
| - { |
| - extensionServer.sendRequest({ command: commands.SetSidebarHeight, id: this._id, height: height }); |
| - }, |
| - |
| setExpression: function(expression, rootTitle, evaluateOptions) |
| { |
| var request = { |