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

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

Issue 2762443002: DevTools: Only show gutter diff for Network UISourceCodes (Closed)
Patch Set: doc Created 3 years, 9 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 | « third_party/WebKit/Source/devtools/front_end/source_frame/SourceCodeDiff.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
index 48354f756e624bb11e4b2ffd96d457be79e49264..0cd305ef20f5d46a3e57faff9d782d2f21ccc2d5 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
@@ -39,7 +39,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
this.setEditable(this._canEditSource());
if (Runtime.experiments.isEnabled('sourceDiff'))
- this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(), uiSourceCode, this.textEditor);
+ this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(), this.textEditor);
/** @type {?UI.AutocompleteConfig} */
@@ -72,6 +72,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
() => UI.context.setFlavor(SourceFrame.UISourceCodeFrame, this));
this._updateStyle();
+ this._updateDiffUISourceCode();
this._errorPopoverHelper = new UI.PopoverHelper(this.element);
this._errorPopoverHelper.initializeCallbacks(this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
@@ -238,6 +239,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
this._installMessageAndDecorationListeners();
this._updateStyle();
this._decorateAllTypes();
+ this._updateDiffUISourceCode();
this.onBindingChanged();
}
@@ -248,6 +250,17 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
// Overriden in subclasses.
}
+ _updateDiffUISourceCode() {
+ if (!this._diff)
+ return;
+ if (this._persistenceBinding)
+ this._diff.setUISourceCode(this._persistenceBinding.network);
+ else if (this._uiSourceCode.project().type() === Workspace.projectTypes.Network)
+ this._diff.setUISourceCode(this._uiSourceCode);
+ else
+ this._diff.setUISourceCode(null);
+ }
+
_updateStyle() {
this.element.classList.toggle(
'source-frame-unsaved-committed-changes',
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/source_frame/SourceCodeDiff.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698