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

Unified Diff: Source/devtools/front_end/InplaceFormatterEditorAction.js

Issue 206063003: DevTools: Extract SourcesEditor from SourcesPanel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/devtools/front_end/InplaceFormatterEditorAction.js
diff --git a/Source/devtools/front_end/InplaceFormatterEditorAction.js b/Source/devtools/front_end/InplaceFormatterEditorAction.js
index 9c7414dfd7f3800339dbe02717c30e1ad6125c60..8f80a6ee4cab7cc28ccff4c9e88f2a23bc8fa92c 100644
--- a/Source/devtools/front_end/InplaceFormatterEditorAction.js
+++ b/Source/devtools/front_end/InplaceFormatterEditorAction.js
@@ -5,7 +5,7 @@
/**
* @constructor
- * @implements {WebInspector.SourcesPanel.EditorAction}
+ * @implements {WebInspector.SourcesEditor.EditorAction}
*/
WebInspector.InplaceFormatterEditorAction = function()
{
@@ -40,17 +40,17 @@ WebInspector.InplaceFormatterEditorAction.prototype = {
},
/**
- * @param {!WebInspector.SourcesPanel} panel
+ * @param {!WebInspector.SourcesEditor} sourcesEditor
* @return {!Element}
*/
- button: function(panel)
+ button: function(sourcesEditor)
{
if (this._button)
return this._button.element;
- this._panel = panel;
- this._panel.addEventListener(WebInspector.SourcesPanel.Events.EditorSelected, this._editorSelected.bind(this));
- this._panel.addEventListener(WebInspector.SourcesPanel.Events.EditorClosed, this._editorClosed.bind(this));
+ this._sourcesEditor = sourcesEditor;
+ this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.EditorSelected, this._editorSelected.bind(this));
+ this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.EditorClosed, this._editorClosed.bind(this));
this._button = new WebInspector.StatusBarButton(WebInspector.UIString("Format"), "sources-toggle-pretty-print-status-bar-item");
this._button.toggled = false;
@@ -74,7 +74,7 @@ WebInspector.InplaceFormatterEditorAction.prototype = {
_formatSourceInPlace: function()
{
- var uiSourceCode = this._panel.selectedUISourceCode();
+ var uiSourceCode = this._sourcesEditor.currentUISourceCode();
if (!this._isFormattable(uiSourceCode))
return;
@@ -102,14 +102,14 @@ WebInspector.InplaceFormatterEditorAction.prototype = {
{
if (uiSourceCode.workingCopy() === formattedContent)
return;
- var sourceFrame = this._panel.viewForFile(uiSourceCode);
+ var sourceFrame = this._sourcesEditor.viewForFile(uiSourceCode);
var start = [0, 0];
if (sourceFrame) {
var selection = sourceFrame.selection();
start = formatterMapping.originalToFormatted(selection.startLine, selection.startColumn);
}
uiSourceCode.setWorkingCopy(formattedContent);
- this._panel.showUISourceCode(uiSourceCode, start[0], start[1]);
+ this._sourcesEditor.showSourceLocation(uiSourceCode, start[0], start[1]);
}
},
}

Powered by Google App Engine
This is Rietveld 408576698