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

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

Issue 1905493002: Make the extension's sidebar pane auto-resizable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up defineDeprecatedMethod, update defineDeprecatedProperty accordingly Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d4e00b00714585f20799d34e8f456359a97ac0e0 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",
@@ -379,15 +378,31 @@ function defineDeprecatedProperty(object, className, oldName, newName)
var warningGiven = false;
function getter()
{
- if (!warningGiven) {
- console.warn(className + "." + oldName + " is deprecated. Use " + className + "." + newName + " instead");
- warningGiven = true;
- }
+ if (warningGiven)
+ return;
caseq 2016/04/20 23:00:47 please revert this -- this is a different case, we
+
+ console.warn(className + "." + oldName + " is deprecated. Use " + className + "." + newName + " instead");
+ warningGiven = true;
+
return object[newName];
}
object.__defineGetter__(oldName, getter);
}
+function defineDeprecatedMethod(object, className, oldName)
+{
+ var warningGiven = false;
+ function noop()
+ {
+ if (warningGiven)
+ return;
caseq 2016/04/20 23:00:47 indent 4 spaces, please.
+
+ console.warn(className + "." + oldName + " is deprecated, please don't use it. It is a no-op.");
+ warningGiven = true;
+ }
+ object[oldName] = noop.bind(null);
caseq 2016/04/20 23:00:47 we don't use this in noop, so I guess you can just
+}
+
function extractCallbackArgument(args)
{
var lastArgument = args[args.length - 1];
@@ -481,14 +496,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 = {
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698