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

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

Issue 2263073003: DevTools: Prepare CodeMirrorTextEditor for split into SourcesTextEditor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 4 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/source_frame/SourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
index 0e5b0be1273d45ac071fe82d455bf99406ba1c3f..1d24736d5403f922fe93f5e8b74a28f1aa5da031 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
@@ -33,6 +33,7 @@
* @extends {WebInspector.SimpleView}
* @implements {WebInspector.Searchable}
* @implements {WebInspector.Replaceable}
+ * @implements {WebInspector.TextEditorDelegate}
* @param {string} url
* @param {function(): !Promise<?string>} lazyContent
*/
@@ -43,9 +44,7 @@ WebInspector.SourceFrame = function(url, lazyContent)
this._url = url;
this._lazyContent = lazyContent;
- var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(this);
-
- this._textEditor = new WebInspector.CodeMirrorTextEditor(this._url, textEditorDelegate);
+ this._textEditor = new WebInspector.CodeMirrorTextEditor(this);
this._currentSearchResultIndex = -1;
this._searchResults = [];
@@ -80,6 +79,9 @@ WebInspector.SourceFrame.prototype = {
this._shortcuts[key] = handler;
},
+ /**
+ * @override
+ */
wasShown: function()
{
this._ensureContentLoaded();
@@ -224,6 +226,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @param {!WebInspector.TextRange} oldRange
* @param {!WebInspector.TextRange} newRange
*/
@@ -354,7 +357,10 @@ WebInspector.SourceFrame.prototype = {
this._ensureContentLoaded();
},
- _editorFocused: function()
+ /**
+ * @override
+ */
+ editorFocused: function()
{
this._resetCurrentSearchResultIndex();
},
@@ -553,6 +559,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @return {!Promise}
*/
populateLineGutterContextMenu: function(contextMenu, lineNumber)
@@ -561,6 +568,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @return {!Promise}
*/
populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber)
@@ -569,6 +577,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @param {?WebInspector.TextRange} from
* @param {?WebInspector.TextRange} to
*/
@@ -589,6 +598,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @param {!WebInspector.TextRange} textRange
*/
selectionChanged: function(textRange)
@@ -621,6 +631,7 @@ WebInspector.SourceFrame.prototype = {
},
/**
+ * @override
* @param {number} lineNumber
*/
scrollChanged: function(lineNumber)
@@ -640,83 +651,3 @@ WebInspector.SourceFrame.prototype = {
__proto__: WebInspector.SimpleView.prototype
}
-
-/**
- * @implements {WebInspector.TextEditorDelegate}
- * @constructor
- */
-WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame)
-{
- this._sourceFrame = sourceFrame;
-}
-
-WebInspector.TextEditorDelegateForSourceFrame.prototype = {
- /**
- * @override
- * @param {!WebInspector.TextRange} oldRange
- * @param {!WebInspector.TextRange} newRange
- */
- onTextChanged: function(oldRange, newRange)
- {
- this._sourceFrame.onTextChanged(oldRange, newRange);
- },
-
- /**
- * @override
- * @param {!WebInspector.TextRange} textRange
- */
- selectionChanged: function(textRange)
- {
- this._sourceFrame.selectionChanged(textRange);
- },
-
- /**
- * @override
- * @param {number} lineNumber
- */
- scrollChanged: function(lineNumber)
- {
- this._sourceFrame.scrollChanged(lineNumber);
- },
-
- /**
- * @override
- */
- editorFocused: function()
- {
- this._sourceFrame._editorFocused();
- },
-
- /**
- * @override
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {number} lineNumber
- * @return {!Promise}
- */
- populateLineGutterContextMenu: function(contextMenu, lineNumber)
- {
- return this._sourceFrame.populateLineGutterContextMenu(contextMenu, lineNumber);
- },
-
- /**
- * @override
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {number} lineNumber
- * @param {number} columnNumber
- * @return {!Promise}
- */
- populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber)
- {
- return this._sourceFrame.populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber);
- },
-
- /**
- * @override
- * @param {?WebInspector.TextRange} from
- * @param {?WebInspector.TextRange} to
- */
- onJumpToPosition: function(from, to)
- {
- this._sourceFrame.onJumpToPosition(from, to);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698