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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 this.onTaskItemClicked_.bind(this)); | 849 this.onTaskItemClicked_.bind(this)); |
850 | 850 |
851 this.dialogDom_.ownerDocument.defaultView.addEventListener( | 851 this.dialogDom_.ownerDocument.defaultView.addEventListener( |
852 'resize', this.onResize_.bind(this)); | 852 'resize', this.onResize_.bind(this)); |
853 | 853 |
854 if (loadTimeData.getBoolean('ASH')) | 854 if (loadTimeData.getBoolean('ASH')) |
855 this.dialogDom_.setAttribute('ash', 'true'); | 855 this.dialogDom_.setAttribute('ash', 'true'); |
856 | 856 |
857 this.filePopup_ = null; | 857 this.filePopup_ = null; |
858 | 858 |
| 859 this.searchBoxWrapper_ = |
| 860 this.dialogDom_.querySelector('.search-box-wrapper'); |
859 this.searchBox_ = this.dialogDom_.querySelector('#search-box'); | 861 this.searchBox_ = this.dialogDom_.querySelector('#search-box'); |
860 this.searchBox_.addEventListener( | 862 this.searchBox_.addEventListener( |
861 'input', this.onSearchBoxUpdate_.bind(this)); | 863 'input', this.onSearchBoxUpdate_.bind(this)); |
862 this.lastSearchQuery_ = ''; | 864 this.lastSearchQuery_ = ''; |
863 | 865 |
864 var autocompleteList = new cr.ui.AutocompleteList(); | 866 var autocompleteList = new cr.ui.AutocompleteList(); |
865 autocompleteList.id = 'autocomplete-list'; | 867 autocompleteList.id = 'autocomplete-list'; |
866 autocompleteList.autoExpands = true; | 868 autocompleteList.autoExpands = true; |
867 autocompleteList.requestSuggestions = | 869 autocompleteList.requestSuggestions = |
868 this.requestAutocompleteSuggestions_.bind(this); | 870 this.requestAutocompleteSuggestions_.bind(this); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 if (this.table_.clientWidth > 0) | 1421 if (this.table_.clientWidth > 0) |
1420 this.table_.normalizeColumns(); | 1422 this.table_.normalizeColumns(); |
1421 } | 1423 } |
1422 this.table_.redraw(); | 1424 this.table_.redraw(); |
1423 this.volumeList_.redraw(); | 1425 this.volumeList_.redraw(); |
1424 } | 1426 } |
1425 | 1427 |
1426 if (!util.platform.newUI()) | 1428 if (!util.platform.newUI()) |
1427 this.breadcrumbs_.truncate(); | 1429 this.breadcrumbs_.truncate(); |
1428 | 1430 |
| 1431 // Hide the search box if there is not enough space. |
| 1432 if (util.platform.newUI()) |
| 1433 this.searchBox_.hidden = this.searchBoxWrapper_.clientWidth < 100; |
| 1434 |
1429 this.searchBreadcrumbs_.truncate(); | 1435 this.searchBreadcrumbs_.truncate(); |
1430 | 1436 |
1431 this.updateWindowState_(); | 1437 this.updateWindowState_(); |
1432 }; | 1438 }; |
1433 | 1439 |
1434 /** | 1440 /** |
1435 * @private | 1441 * @private |
1436 */ | 1442 */ |
1437 FileManager.prototype.updateWindowState_ = function() { | 1443 FileManager.prototype.updateWindowState_ = function() { |
1438 util.platform.getWindowStatus(function(wnd) { | 1444 util.platform.getWindowStatus(function(wnd) { |
(...skipping 2210 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 |