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

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

Issue 2287713002: DevTools: remove UISourceCodeFrame from context when switching panels. (Closed)
Patch Set: follow-up 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);
84 this._boundWindowFocused = this._windowFocused.bind(this); 85 this._boundWindowFocused = this._windowFocused.bind(this);
85 this.element.ownerDocument.defaultView.addEventListener("focus", this._b oundWindowFocused, false); 86 this.element.ownerDocument.defaultView.addEventListener("focus", this._b oundWindowFocused, false);
86 this._checkContentUpdated(); 87 this._checkContentUpdated();
87 // We need CodeMirrorTextEditor to be initialized prior to this call as it calls |cursorPositionToCoordinates| internally. @see crbug.com/506566 88 // We need CodeMirrorTextEditor to be initialized prior to this call as it calls |cursorPositionToCoordinates| internally. @see crbug.com/506566
88 setImmediate(this._updateBucketDecorations.bind(this)); 89 setImmediate(this._updateBucketDecorations.bind(this));
89 }, 90 },
90 91
91 willHide: function() 92 willHide: function()
92 { 93 {
93 WebInspector.SourceFrame.prototype.willHide.call(this); 94 WebInspector.SourceFrame.prototype.willHide.call(this);
95 WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, null);
94 this.element.ownerDocument.defaultView.removeEventListener("focus", this ._boundWindowFocused, false); 96 this.element.ownerDocument.defaultView.removeEventListener("focus", this ._boundWindowFocused, false);
95 delete this._boundWindowFocused; 97 delete this._boundWindowFocused;
96 this._uiSourceCode.removeWorkingCopyGetter(); 98 this._uiSourceCode.removeWorkingCopyGetter();
97 }, 99 },
98 100
99 /** 101 /**
100 * @override 102 * @override
101 * @return {boolean} 103 * @return {boolean}
102 */ 104 */
103 canEditSource: function() 105 canEditSource: function()
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 649
648 /** 650 /**
649 * @param {!WebInspector.UISourceCode.Message} a 651 * @param {!WebInspector.UISourceCode.Message} a
650 * @param {!WebInspector.UISourceCode.Message} b 652 * @param {!WebInspector.UISourceCode.Message} b
651 * @return {number} 653 * @return {number}
652 */ 654 */
653 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b) 655 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b)
654 { 656 {
655 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()]; 657 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()];
656 } 658 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698