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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js

Issue 1855363002: DevTools: [ux regression] There is no way to clear console history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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) 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 15 matching lines...) Expand all
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.ConsolePanel._view(); 36 this._view = WebInspector.ConsoleView.instance();
37 }
38
39 /**
40 * @return {!WebInspector.ConsoleView}
41 */
42 WebInspector.ConsolePanel._view = function()
43 {
44 if (!WebInspector.ConsolePanel._consoleView)
45 WebInspector.ConsolePanel._consoleView = new WebInspector.ConsoleView();
46
47 return WebInspector.ConsolePanel._consoleView;
48 } 37 }
49 38
50 WebInspector.ConsolePanel.prototype = { 39 WebInspector.ConsolePanel.prototype = {
51 /** 40 /**
52 * @override 41 * @override
53 * @return {!Element} 42 * @return {!Element}
54 */ 43 */
55 defaultFocusedElement: function() 44 defaultFocusedElement: function()
56 { 45 {
57 return this._view.defaultFocusedElement(); 46 return this._view.defaultFocusedElement();
(...skipping 21 matching lines...) Expand all
79 WebInspector.ConsolePanel.WrapperView._instance._showViewInWrapper() ; 68 WebInspector.ConsolePanel.WrapperView._instance._showViewInWrapper() ;
80 WebInspector.inspectorView.setDrawerMinimized(false); 69 WebInspector.inspectorView.setDrawerMinimized(false);
81 }, 70 },
82 71
83 /** 72 /**
84 * @override 73 * @override
85 * @return {?WebInspector.SearchableView} 74 * @return {?WebInspector.SearchableView}
86 */ 75 */
87 searchableView: function() 76 searchableView: function()
88 { 77 {
89 return WebInspector.ConsolePanel._view().searchableView(); 78 return WebInspector.ConsoleView.instance().searchableView();
90 }, 79 },
91 80
92 __proto__: WebInspector.Panel.prototype 81 __proto__: WebInspector.Panel.prototype
93 } 82 }
94 83
95 /** 84 /**
96 * @constructor 85 * @constructor
97 * @extends {WebInspector.VBox} 86 * @extends {WebInspector.VBox}
98 */ 87 */
99 WebInspector.ConsolePanel.WrapperView = function() 88 WebInspector.ConsolePanel.WrapperView = function()
100 { 89 {
101 WebInspector.VBox.call(this); 90 WebInspector.VBox.call(this);
102 this.element.classList.add("console-view-wrapper"); 91 this.element.classList.add("console-view-wrapper");
103 92
104 WebInspector.ConsolePanel.WrapperView._instance = this; 93 WebInspector.ConsolePanel.WrapperView._instance = this;
105 94
106 this._view = WebInspector.ConsolePanel._view(); 95 this._view = WebInspector.ConsoleView.instance();
107 } 96 }
108 97
109 WebInspector.ConsolePanel.WrapperView.prototype = { 98 WebInspector.ConsolePanel.WrapperView.prototype = {
110 wasShown: function() 99 wasShown: function()
111 { 100 {
112 if (!WebInspector.inspectorView.currentPanel() || WebInspector.inspector View.currentPanel().name !== "console") 101 if (!WebInspector.inspectorView.currentPanel() || WebInspector.inspector View.currentPanel().name !== "console")
113 this._showViewInWrapper(); 102 this._showViewInWrapper();
114 else 103 else
115 WebInspector.inspectorView.setDrawerMinimized(true); 104 WebInspector.inspectorView.setDrawerMinimized(true);
116 }, 105 },
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 140 }
152 141
153 WebInspector.ConsolePanel.ConsoleRevealer.prototype = { 142 WebInspector.ConsolePanel.ConsoleRevealer.prototype = {
154 /** 143 /**
155 * @override 144 * @override
156 * @param {!Object} object 145 * @param {!Object} object
157 * @return {!Promise} 146 * @return {!Promise}
158 */ 147 */
159 reveal: function(object) 148 reveal: function(object)
160 { 149 {
161 var consoleView = WebInspector.ConsolePanel._view(); 150 var consoleView = WebInspector.ConsoleView.instance();
162 if (consoleView.isShowing()) { 151 if (consoleView.isShowing()) {
163 consoleView.focus(); 152 consoleView.focus();
164 return Promise.resolve(); 153 return Promise.resolve();
165 } 154 }
166 WebInspector.inspectorView.showViewInDrawer("console"); 155 WebInspector.inspectorView.showViewInDrawer("console");
167 return Promise.resolve(); 156 return Promise.resolve();
168 } 157 }
169 } 158 }
170 159
171 WebInspector.ConsolePanel.show = function() 160 WebInspector.ConsolePanel.show = function()
(...skipping 22 matching lines...) Expand all
194 WebInspector.ConsolePanelFactory.prototype = { 183 WebInspector.ConsolePanelFactory.prototype = {
195 /** 184 /**
196 * @override 185 * @override
197 * @return {!WebInspector.Panel} 186 * @return {!WebInspector.Panel}
198 */ 187 */
199 createPanel: function() 188 createPanel: function()
200 { 189 {
201 return WebInspector.ConsolePanel._instance(); 190 return WebInspector.ConsolePanel._instance();
202 } 191 }
203 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698