OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) IBM Corp. 2009 All rights reserved. | 3 * Copyright (C) IBM Corp. 2009 All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 * @return {!Promise} | 52 * @return {!Promise} |
53 */ | 53 */ |
54 populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber) | 54 populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber) |
55 { | 55 { |
56 contextMenu.appendApplicableItems(this._resource); | 56 contextMenu.appendApplicableItems(this._resource); |
57 return Promise.resolve(); | 57 return Promise.resolve(); |
58 }, | 58 }, |
59 | 59 |
60 __proto__: WebInspector.SourceFrame.prototype | 60 __proto__: WebInspector.SourceFrame.prototype |
61 } | 61 } |
62 | |
63 /** | |
64 * @constructor | |
65 * @extends {WebInspector.VBox} | |
66 * @param {!WebInspector.ContentProvider} resource | |
67 */ | |
68 WebInspector.ResourceSourceFrameFallback = function(resource) | |
69 { | |
70 WebInspector.VBox.call(this); | |
71 this.registerRequiredCSS("source_frame/resourceSourceFrame.css"); | |
72 this._resource = resource; | |
73 this._content = this.element.createChild("div", "resource-source-frame-fallb
ack monospace"); | |
74 } | |
75 | |
76 WebInspector.ResourceSourceFrameFallback.prototype = { | |
77 wasShown: function() | |
78 { | |
79 if (!this._contentRequested) { | |
80 this._contentRequested = true; | |
81 this._resource.requestContent(this._contentLoaded.bind(this)); | |
82 } | |
83 }, | |
84 | |
85 /** | |
86 * @param {?string} content | |
87 */ | |
88 _contentLoaded: function(content) | |
89 { | |
90 this._content.textContent = content; | |
91 }, | |
92 | |
93 __proto__: WebInspector.VBox.prototype | |
94 } | |
OLD | NEW |