| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Joseph Pecoraro | 2 * Copyright (C) 2009 Joseph Pecoraro |
| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @constructor | 30 * @constructor |
| 31 * @extends {WebInspector.Panel} | 31 * @extends {WebInspector.Panel} |
| 32 */ | 32 */ |
| 33 WebInspector.ConsolePanel = function() | 33 WebInspector.ConsolePanel = function() |
| 34 { | 34 { |
| 35 WebInspector.Panel.call(this, "console"); | 35 WebInspector.Panel.call(this, "console"); |
| 36 this._view = WebInspector.ConsoleView.instance(); | 36 this._view = WebInspector.ConsoleView.instance(); |
| 37 } | 37 }; |
| 38 | 38 |
| 39 WebInspector.ConsolePanel.prototype = { | 39 WebInspector.ConsolePanel.prototype = { |
| 40 /** | 40 /** |
| 41 * @override | 41 * @override |
| 42 */ | 42 */ |
| 43 wasShown: function() | 43 wasShown: function() |
| 44 { | 44 { |
| 45 WebInspector.Panel.prototype.wasShown.call(this); | 45 WebInspector.Panel.prototype.wasShown.call(this); |
| 46 var wrapper = WebInspector.ConsolePanel.WrapperView._instance; | 46 var wrapper = WebInspector.ConsolePanel.WrapperView._instance; |
| 47 if (wrapper && wrapper.isShowing()) | 47 if (wrapper && wrapper.isShowing()) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 63 /** | 63 /** |
| 64 * @override | 64 * @override |
| 65 * @return {?WebInspector.SearchableView} | 65 * @return {?WebInspector.SearchableView} |
| 66 */ | 66 */ |
| 67 searchableView: function() | 67 searchableView: function() |
| 68 { | 68 { |
| 69 return WebInspector.ConsoleView.instance().searchableView(); | 69 return WebInspector.ConsoleView.instance().searchableView(); |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 __proto__: WebInspector.Panel.prototype | 72 __proto__: WebInspector.Panel.prototype |
| 73 } | 73 }; |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * @constructor | 76 * @constructor |
| 77 * @extends {WebInspector.VBox} | 77 * @extends {WebInspector.VBox} |
| 78 */ | 78 */ |
| 79 WebInspector.ConsolePanel.WrapperView = function() | 79 WebInspector.ConsolePanel.WrapperView = function() |
| 80 { | 80 { |
| 81 WebInspector.VBox.call(this); | 81 WebInspector.VBox.call(this); |
| 82 this.element.classList.add("console-view-wrapper"); | 82 this.element.classList.add("console-view-wrapper"); |
| 83 | 83 |
| 84 WebInspector.ConsolePanel.WrapperView._instance = this; | 84 WebInspector.ConsolePanel.WrapperView._instance = this; |
| 85 | 85 |
| 86 this._view = WebInspector.ConsoleView.instance(); | 86 this._view = WebInspector.ConsoleView.instance(); |
| 87 } | 87 }; |
| 88 | 88 |
| 89 WebInspector.ConsolePanel.WrapperView.prototype = { | 89 WebInspector.ConsolePanel.WrapperView.prototype = { |
| 90 wasShown: function() | 90 wasShown: function() |
| 91 { | 91 { |
| 92 if (!WebInspector.ConsolePanel.instance().isShowing()) | 92 if (!WebInspector.ConsolePanel.instance().isShowing()) |
| 93 this._showViewInWrapper(); | 93 this._showViewInWrapper(); |
| 94 else | 94 else |
| 95 WebInspector.inspectorView.setDrawerMinimized(true); | 95 WebInspector.inspectorView.setDrawerMinimized(true); |
| 96 }, | 96 }, |
| 97 | 97 |
| 98 willHide: function() | 98 willHide: function() |
| 99 { | 99 { |
| 100 WebInspector.inspectorView.setDrawerMinimized(false); | 100 WebInspector.inspectorView.setDrawerMinimized(false); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 _showViewInWrapper: function() | 103 _showViewInWrapper: function() |
| 104 { | 104 { |
| 105 this._view.show(this.element); | 105 this._view.show(this.element); |
| 106 }, | 106 }, |
| 107 | 107 |
| 108 __proto__: WebInspector.VBox.prototype | 108 __proto__: WebInspector.VBox.prototype |
| 109 } | 109 }; |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * @constructor | 112 * @constructor |
| 113 * @implements {WebInspector.Revealer} | 113 * @implements {WebInspector.Revealer} |
| 114 */ | 114 */ |
| 115 WebInspector.ConsolePanel.ConsoleRevealer = function() | 115 WebInspector.ConsolePanel.ConsoleRevealer = function() |
| 116 { | 116 { |
| 117 } | 117 }; |
| 118 | 118 |
| 119 WebInspector.ConsolePanel.ConsoleRevealer.prototype = { | 119 WebInspector.ConsolePanel.ConsoleRevealer.prototype = { |
| 120 /** | 120 /** |
| 121 * @override | 121 * @override |
| 122 * @param {!Object} object | 122 * @param {!Object} object |
| 123 * @return {!Promise} | 123 * @return {!Promise} |
| 124 */ | 124 */ |
| 125 reveal: function(object) | 125 reveal: function(object) |
| 126 { | 126 { |
| 127 var consoleView = WebInspector.ConsoleView.instance(); | 127 var consoleView = WebInspector.ConsoleView.instance(); |
| 128 if (consoleView.isShowing()) { | 128 if (consoleView.isShowing()) { |
| 129 consoleView.focus(); | 129 consoleView.focus(); |
| 130 return Promise.resolve(); | 130 return Promise.resolve(); |
| 131 } | 131 } |
| 132 WebInspector.viewManager.showView("console-view"); | 132 WebInspector.viewManager.showView("console-view"); |
| 133 return Promise.resolve(); | 133 return Promise.resolve(); |
| 134 } | 134 } |
| 135 } | 135 }; |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * @return {!WebInspector.ConsolePanel} | 138 * @return {!WebInspector.ConsolePanel} |
| 139 */ | 139 */ |
| 140 WebInspector.ConsolePanel.instance = function() | 140 WebInspector.ConsolePanel.instance = function() |
| 141 { | 141 { |
| 142 return /** @type {!WebInspector.ConsolePanel} */ (self.runtime.sharedInstanc
e(WebInspector.ConsolePanel)); | 142 return /** @type {!WebInspector.ConsolePanel} */ (self.runtime.sharedInstanc
e(WebInspector.ConsolePanel)); |
| 143 } | 143 }; |
| OLD | NEW |