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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined Created 4 years, 2 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/sources/UISourceCodeFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
index 1b56b0e274fe53d0989e701251bbe140081f7c86..8d3972f6db8924ff45375f1ee4e6858c1ecd3789 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -33,8 +33,9 @@
*/
WebInspector.UISourceCodeFrame = function(uiSourceCode)
{
- this._uiSourceCode = uiSourceCode;
WebInspector.SourceFrame.call(this, uiSourceCode.contentURL(), workingCopy);
+ this._uiSourceCode = uiSourceCode;
+ this.setEditable(this._canEditSource());
if (Runtime.experiments.isEnabled("sourceDiff"))
this._diff = new WebInspector.SourceCodeDiff(uiSourceCode.requestOriginalContent(), this.textEditor);
@@ -63,7 +64,9 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode)
this._updateStyle();
- this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element, this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
+ this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element);
+ this._errorPopoverHelper.initializeCallbacks(this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
+
this._errorPopoverHelper.setTimeout(100, 100);
/**
@@ -106,10 +109,9 @@ WebInspector.UISourceCodeFrame.prototype = {
},
/**
- * @override
* @return {boolean}
*/
- canEditSource: function()
+ _canEditSource: function()
{
if (WebInspector.persistence.binding(this._uiSourceCode))
return true;
@@ -214,7 +216,7 @@ WebInspector.UISourceCodeFrame.prototype = {
_updateStyle: function()
{
this.element.classList.toggle("source-frame-unsaved-committed-changes", WebInspector.persistence.hasUnsavedCommittedChanges(this._uiSourceCode));
- this._textEditor.setReadOnly(!this.canEditSource());
+ this.setEditable(!this._canEditSource());
},
onUISourceCodeContentChanged: function()

Powered by Google App Engine
This is Rietveld 408576698