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

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

Issue 2649023007: DevTools: implement release note behind an experiment (Closed)
Patch Set: fixup Created 3 years, 10 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
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 19 matching lines...) Expand all
30 * @implements {UI.Searchable} 30 * @implements {UI.Searchable}
31 * @implements {SDK.TargetManager.Observer} 31 * @implements {SDK.TargetManager.Observer}
32 * @implements {Console.ConsoleViewportProvider} 32 * @implements {Console.ConsoleViewportProvider}
33 * @unrestricted 33 * @unrestricted
34 */ 34 */
35 Console.ConsoleView = class extends UI.VBox { 35 Console.ConsoleView = class extends UI.VBox {
36 constructor() { 36 constructor() {
37 super(); 37 super();
38 this.setMinimumSize(0, 35); 38 this.setMinimumSize(0, 35);
39 this.registerRequiredCSS('console/consoleView.css'); 39 this.registerRequiredCSS('console/consoleView.css');
40 this.registerRequiredCSS('console/releaseNoteMessage.css');
luoe 2017/02/11 00:30:54 Could we move releaseNoteMessage.css into the help
40 41
41 this._searchableView = new UI.SearchableView(this); 42 this._searchableView = new UI.SearchableView(this);
42 this._searchableView.setPlaceholder(Common.UIString('Find string in logs')); 43 this._searchableView.setPlaceholder(Common.UIString('Find string in logs'));
43 this._searchableView.setMinimalSearchQuerySize(0); 44 this._searchableView.setMinimalSearchQuerySize(0);
44 this._searchableView.show(this.element); 45 this._searchableView.show(this.element);
45 46
46 this._contentsElement = this._searchableView.element; 47 this._contentsElement = this._searchableView.element;
47 this._contentsElement.classList.add('console-view'); 48 this._contentsElement.classList.add('console-view');
48 /** @type {!Array.<!Console.ConsoleViewMessage>} */ 49 /** @type {!Array.<!Console.ConsoleViewMessage>} */
49 this._visibleViewMessages = []; 50 this._visibleViewMessages = [];
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 128
128 this._registerShortcuts(); 129 this._registerShortcuts();
129 130
130 this._messagesElement.addEventListener('contextmenu', this._handleContextMen uEvent.bind(this), false); 131 this._messagesElement.addEventListener('contextmenu', this._handleContextMen uEvent.bind(this), false);
131 Common.moduleSetting('monitoringXHREnabled').addChangeListener(this._monitor ingXHREnabledSettingChanged, this); 132 Common.moduleSetting('monitoringXHREnabled').addChangeListener(this._monitor ingXHREnabledSettingChanged, this);
132 133
133 this._linkifier = new Components.Linkifier(); 134 this._linkifier = new Components.Linkifier();
134 135
135 /** @type {!Array.<!Console.ConsoleViewMessage>} */ 136 /** @type {!Array.<!Console.ConsoleViewMessage>} */
136 this._consoleMessages = []; 137 this._consoleMessages = [];
138
139 this._releaseNoteManager = new Help.ReleaseNoteManager();
140 if (!Host.isUnderTest())
141 this._addReleaseNote();
137 this._viewMessageSymbol = Symbol('viewMessage'); 142 this._viewMessageSymbol = Symbol('viewMessage');
138 143
139 this._consoleHistorySetting = Common.settings.createLocalSetting('consoleHis tory', []); 144 this._consoleHistorySetting = Common.settings.createLocalSetting('consoleHis tory', []);
140 145
141 this._prompt = new Console.ConsolePrompt(); 146 this._prompt = new Console.ConsolePrompt();
142 this._prompt.show(this._promptElement); 147 this._prompt.show(this._promptElement);
143 this._prompt.element.addEventListener('keydown', this._promptKeyDown.bind(th is), true); 148 this._prompt.element.addEventListener('keydown', this._promptKeyDown.bind(th is), true);
144 149
145 this._consoleHistoryAutocompleteSetting = Common.moduleSetting('consoleHisto ryAutocomplete'); 150 this._consoleHistoryAutocompleteSetting = Common.moduleSetting('consoleHisto ryAutocomplete');
146 this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHisto ryAutocompleteChanged, this); 151 this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHisto ryAutocompleteChanged, this);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 186 }
182 } 187 }
183 188
184 /** 189 /**
185 * @return {!UI.SearchableView} 190 * @return {!UI.SearchableView}
186 */ 191 */
187 searchableView() { 192 searchableView() {
188 return this._searchableView; 193 return this._searchableView;
189 } 194 }
190 195
196 /**
197 * @param {number} version
198 */
199 removeReleaseNote(version) {
200 this._consoleMessages = this._consoleMessages.filter(
201 message => message.consoleMessage().level !== SDK.ConsoleMessage.Message Level.Note);
202 this._releaseNoteManager.sawReleaseNote(version);
203 this._updateMessageList();
204 }
205
206 /**
207 * @param {number} version
208 */
209 sawReleaseNote(version) {
210 this._releaseNoteManager.sawReleaseNote(version);
211 }
212
213 _addReleaseNote() {
214 var releaseNote = this._releaseNoteManager.maybeGetReleaseNote();
215 if (releaseNote)
216 this._addConsoleMessage(releaseNote);
217 }
218
191 _clearHistory() { 219 _clearHistory() {
192 this._consoleHistorySetting.set([]); 220 this._consoleHistorySetting.set([]);
193 this._prompt.history().setHistoryData([]); 221 this._prompt.history().setHistoryData([]);
194 } 222 }
195 223
196 _consoleHistoryAutocompleteChanged() { 224 _consoleHistoryAutocompleteChanged() {
197 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocompleteSe tting.get()); 225 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocompleteSe tting.get());
198 } 226 }
199 227
200 _initConsoleMessages() { 228 _initConsoleMessages() {
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 return true; 1342 return true;
1315 } 1343 }
1316 return false; 1344 return false;
1317 } 1345 }
1318 }; 1346 };
1319 1347
1320 /** 1348 /**
1321 * @typedef {{messageIndex: number, matchIndex: number}} 1349 * @typedef {{messageIndex: number, matchIndex: number}}
1322 */ 1350 */
1323 Console.ConsoleView.RegexMatchRange; 1351 Console.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698