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

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

Issue 2311303002: Revert of DevTools: remove UISourceCodeFrame from context when switching panels. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 * @return {!WebInspector.UISourceCode} 74 * @return {!WebInspector.UISourceCode}
75 */ 75 */
76 uiSourceCode: function() 76 uiSourceCode: function()
77 { 77 {
78 return this._uiSourceCode; 78 return this._uiSourceCode;
79 }, 79 },
80 80
81 wasShown: function() 81 wasShown: function()
82 { 82 {
83 WebInspector.SourceFrame.prototype.wasShown.call(this); 83 WebInspector.SourceFrame.prototype.wasShown.call(this);
84 WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, this);
85 this._boundWindowFocused = this._windowFocused.bind(this); 84 this._boundWindowFocused = this._windowFocused.bind(this);
86 this.element.ownerDocument.defaultView.addEventListener("focus", this._b oundWindowFocused, false); 85 this.element.ownerDocument.defaultView.addEventListener("focus", this._b oundWindowFocused, false);
87 this._checkContentUpdated(); 86 this._checkContentUpdated();
88 // We need CodeMirrorTextEditor to be initialized prior to this call as it calls |cursorPositionToCoordinates| internally. @see crbug.com/506566 87 // We need CodeMirrorTextEditor to be initialized prior to this call as it calls |cursorPositionToCoordinates| internally. @see crbug.com/506566
89 setImmediate(this._updateBucketDecorations.bind(this)); 88 setImmediate(this._updateBucketDecorations.bind(this));
90 }, 89 },
91 90
92 willHide: function() 91 willHide: function()
93 { 92 {
94 WebInspector.SourceFrame.prototype.willHide.call(this); 93 WebInspector.SourceFrame.prototype.willHide.call(this);
95 WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, null);
96 this.element.ownerDocument.defaultView.removeEventListener("focus", this ._boundWindowFocused, false); 94 this.element.ownerDocument.defaultView.removeEventListener("focus", this ._boundWindowFocused, false);
97 delete this._boundWindowFocused; 95 delete this._boundWindowFocused;
98 this._uiSourceCode.removeWorkingCopyGetter(); 96 this._uiSourceCode.removeWorkingCopyGetter();
99 }, 97 },
100 98
101 /** 99 /**
102 * @override 100 * @override
103 * @return {boolean} 101 * @return {boolean}
104 */ 102 */
105 canEditSource: function() 103 canEditSource: function()
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 647
650 /** 648 /**
651 * @param {!WebInspector.UISourceCode.Message} a 649 * @param {!WebInspector.UISourceCode.Message} a
652 * @param {!WebInspector.UISourceCode.Message} b 650 * @param {!WebInspector.UISourceCode.Message} b
653 * @return {number} 651 * @return {number}
654 */ 652 */
655 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b) 653 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b)
656 { 654 {
657 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()]; 655 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()];
658 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698