OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
9 * @type {number} | 9 * @type {number} |
10 */ | 10 */ |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 this.onTaskItemClicked_.bind(this)); | 853 this.onTaskItemClicked_.bind(this)); |
854 | 854 |
855 this.dialogDom_.ownerDocument.defaultView.addEventListener( | 855 this.dialogDom_.ownerDocument.defaultView.addEventListener( |
856 'resize', this.onResize_.bind(this)); | 856 'resize', this.onResize_.bind(this)); |
857 | 857 |
858 if (loadTimeData.getBoolean('ASH')) | 858 if (loadTimeData.getBoolean('ASH')) |
859 this.dialogDom_.setAttribute('ash', 'true'); | 859 this.dialogDom_.setAttribute('ash', 'true'); |
860 | 860 |
861 this.filePopup_ = null; | 861 this.filePopup_ = null; |
862 | 862 |
| 863 this.searchBoxWrapper_ = |
| 864 this.dialogDom_.querySelector('.search-box-wrapper'); |
863 this.searchBox_ = this.dialogDom_.querySelector('#search-box'); | 865 this.searchBox_ = this.dialogDom_.querySelector('#search-box'); |
864 this.searchBox_.addEventListener( | 866 this.searchBox_.addEventListener( |
865 'input', this.onSearchBoxUpdate_.bind(this)); | 867 'input', this.onSearchBoxUpdate_.bind(this)); |
866 this.lastSearchQuery_ = ''; | 868 this.lastSearchQuery_ = ''; |
867 | 869 |
868 var autocompleteList = new cr.ui.AutocompleteList(); | 870 var autocompleteList = new cr.ui.AutocompleteList(); |
869 autocompleteList.id = 'autocomplete-list'; | 871 autocompleteList.id = 'autocomplete-list'; |
870 autocompleteList.autoExpands = true; | 872 autocompleteList.autoExpands = true; |
871 autocompleteList.requestSuggestions = | 873 autocompleteList.requestSuggestions = |
872 this.requestAutocompleteSuggestions_.bind(this); | 874 this.requestAutocompleteSuggestions_.bind(this); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 if (this.table_.clientWidth > 0) | 1425 if (this.table_.clientWidth > 0) |
1424 this.table_.normalizeColumns(); | 1426 this.table_.normalizeColumns(); |
1425 } | 1427 } |
1426 this.table_.redraw(); | 1428 this.table_.redraw(); |
1427 this.volumeList_.redraw(); | 1429 this.volumeList_.redraw(); |
1428 } | 1430 } |
1429 | 1431 |
1430 if (!util.platform.newUI()) | 1432 if (!util.platform.newUI()) |
1431 this.breadcrumbs_.truncate(); | 1433 this.breadcrumbs_.truncate(); |
1432 | 1434 |
| 1435 // Hide the search box if there is not enough space. |
| 1436 if (util.platform.newUI()) |
| 1437 this.searchBox_.hidden = this.searchBoxWrapper_.clientWidth < 100; |
| 1438 |
1433 this.searchBreadcrumbs_.truncate(); | 1439 this.searchBreadcrumbs_.truncate(); |
1434 | 1440 |
1435 this.updateWindowState_(); | 1441 this.updateWindowState_(); |
1436 }; | 1442 }; |
1437 | 1443 |
1438 /** | 1444 /** |
1439 * @private | 1445 * @private |
1440 */ | 1446 */ |
1441 FileManager.prototype.updateWindowState_ = function() { | 1447 FileManager.prototype.updateWindowState_ = function() { |
1442 util.platform.getWindowStatus(function(wnd) { | 1448 util.platform.getWindowStatus(function(wnd) { |
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3649 * Set the flag expressing whether the ctrl key is pressed or not. | 3655 * Set the flag expressing whether the ctrl key is pressed or not. |
3650 * @param {boolean} flag New value of the flag | 3656 * @param {boolean} flag New value of the flag |
3651 * @private | 3657 * @private |
3652 */ | 3658 */ |
3653 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3659 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3654 this.ctrlKeyPressed_ = flag; | 3660 this.ctrlKeyPressed_ = flag; |
3655 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3661 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3656 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3662 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3657 }; | 3663 }; |
3658 })(); | 3664 })(); |
OLD | NEW |