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

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

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 this.element.style.width = newElementPosition.width + borderWidth * 2 + "px"; 247 this.element.style.width = newElementPosition.width + borderWidth * 2 + "px";
248 this.element.style.height = newElementPosition.height + borderWidth * 2 + "px"; 248 this.element.style.height = newElementPosition.height + borderWidth * 2 + "px";
249 }, 249 },
250 250
251 __proto__: WebInspector.Widget.prototype 251 __proto__: WebInspector.Widget.prototype
252 }; 252 };
253 253
254 /** 254 /**
255 * @constructor 255 * @constructor
256 * @param {!Element} panelElement 256 * @param {!Element} panelElement
257 * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAnchor
258 * @param {function(!Element, !WebInspector.Popover):undefined} showPopover
259 * @param {function()=} onHide
260 * @param {boolean=} disableOnClick 257 * @param {boolean=} disableOnClick
261 */ 258 */
262 WebInspector.PopoverHelper = function(panelElement, getAnchor, showPopover, onHi de, disableOnClick) 259 WebInspector.PopoverHelper = function(panelElement, disableOnClick)
263 { 260 {
264 this._getAnchor = getAnchor;
265 this._showPopover = showPopover;
266 this._onHide = onHide;
267 this._disableOnClick = !!disableOnClick; 261 this._disableOnClick = !!disableOnClick;
268 panelElement.addEventListener("mousedown", this._mouseDown.bind(this), false ); 262 panelElement.addEventListener("mousedown", this._mouseDown.bind(this), false );
269 panelElement.addEventListener("mousemove", this._mouseMove.bind(this), false ); 263 panelElement.addEventListener("mousemove", this._mouseMove.bind(this), false );
270 panelElement.addEventListener("mouseout", this._mouseOut.bind(this), false); 264 panelElement.addEventListener("mouseout", this._mouseOut.bind(this), false);
271 this.setTimeout(1000, 500); 265 this.setTimeout(1000, 500);
272 }; 266 };
273 267
274 WebInspector.PopoverHelper.prototype = { 268 WebInspector.PopoverHelper.prototype = {
275 /** 269 /**
270 * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAn chor
271 * @param {function(!Element, !WebInspector.Popover):undefined} showPopover
272 * @param {function()=} onHide
273 */
274 initializeCallbacks:function(getAnchor, showPopover, onHide)
275 {
276 this._getAnchor = getAnchor;
277 this._showPopover = showPopover;
278 this._onHide = onHide;
279 },
280
281 /**
276 * @param {number} timeout 282 * @param {number} timeout
277 * @param {number=} hideTimeout 283 * @param {number=} hideTimeout
278 */ 284 */
279 setTimeout: function(timeout, hideTimeout) 285 setTimeout: function(timeout, hideTimeout)
280 { 286 {
281 this._timeout = timeout; 287 this._timeout = timeout;
282 if (typeof hideTimeout === "number") 288 if (typeof hideTimeout === "number")
283 this._hideTimeout = hideTimeout; 289 this._hideTimeout = hideTimeout;
284 else 290 else
285 this._hideTimeout = timeout / 2; 291 this._hideTimeout = timeout / 2;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 this._resetHoverTimer(); 424 this._resetHoverTimer();
419 } 425 }
420 } 426 }
421 }; 427 };
422 428
423 /** @enum {string} */ 429 /** @enum {string} */
424 WebInspector.Popover.Orientation = { 430 WebInspector.Popover.Orientation = {
425 Top: "top", 431 Top: "top",
426 Bottom: "bottom" 432 Bottom: "bottom"
427 }; 433 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698