OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 /** | 4 /** |
5 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Sources.AdvancedSearchView = class extends UI.VBox { | 7 Sources.AdvancedSearchView = class extends UI.VBox { |
8 constructor() { | 8 constructor() { |
9 super(true); | 9 super(true); |
10 this.setMinimumSize(0, 40); | 10 this.setMinimumSize(0, 40); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 /** | 230 /** |
231 * @param {boolean} finished | 231 * @param {boolean} finished |
232 */ | 232 */ |
233 _indexingFinished(finished) { | 233 _indexingFinished(finished) { |
234 this._searchMessageElement.textContent = finished ? '' : Common.UIString('In
dexing interrupted.'); | 234 this._searchMessageElement.textContent = finished ? '' : Common.UIString('In
dexing interrupted.'); |
235 } | 235 } |
236 | 236 |
237 _updateSearchResultsMessage() { | 237 _updateSearchResultsMessage() { |
238 if (this._searchMatchesCount && this._searchResultsCount) { | 238 if (this._searchMatchesCount && this._searchResultsCount) { |
239 this._searchResultsMessageElement.textContent = | 239 if (this._searchMatchesCount === 1 && this._nonEmptySearchResultsCount ===
1) { |
240 Common.UIString('Found %d matches in %d files.', this._searchMatchesCo
unt, this._nonEmptySearchResultsCount); | 240 this._searchResultsMessageElement.textContent = Common.UIString('Found 1
matching line in 1 file.'); |
| 241 } else if (this._searchMatchesCount > 1 && this._nonEmptySearchResultsCoun
t === 1) { |
| 242 this._searchResultsMessageElement.textContent = |
| 243 Common.UIString('Found %d matching lines in 1 file.', this._searchMa
tchesCount); |
| 244 } else { |
| 245 this._searchResultsMessageElement.textContent = Common.UIString( |
| 246 'Found %d matching lines in %d files.', this._searchMatchesCount, th
is._nonEmptySearchResultsCount); |
| 247 } |
241 } else { | 248 } else { |
242 this._searchResultsMessageElement.textContent = ''; | 249 this._searchResultsMessageElement.textContent = ''; |
243 } | 250 } |
244 } | 251 } |
245 | 252 |
246 _resetResults() { | 253 _resetResults() { |
247 if (this._searchingView) | 254 if (this._searchingView) |
248 this._searchingView.detach(); | 255 this._searchingView.detach(); |
249 if (this._notFoundView) | 256 if (this._notFoundView) |
250 this._notFoundView.detach(); | 257 this._notFoundView.detach(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 performIndexing(progress) {}, | 434 performIndexing(progress) {}, |
428 | 435 |
429 stopSearch() {}, | 436 stopSearch() {}, |
430 | 437 |
431 /** | 438 /** |
432 * @param {!Workspace.ProjectSearchConfig} searchConfig | 439 * @param {!Workspace.ProjectSearchConfig} searchConfig |
433 * @return {!Sources.SearchResultsPane} | 440 * @return {!Sources.SearchResultsPane} |
434 */ | 441 */ |
435 createSearchResultsPane(searchConfig) {} | 442 createSearchResultsPane(searchConfig) {} |
436 }; | 443 }; |
OLD | NEW |