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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1053 setTimeout(this.dailyUpdateModificationTime_.bind(this), | 1053 setTimeout(this.dailyUpdateModificationTime_.bind(this), |
1054 today.getTime() + MILLISECONDS_IN_DAY - Date.now() + 1000); | 1054 today.getTime() + MILLISECONDS_IN_DAY - Date.now() + 1000); |
1055 }; | 1055 }; |
1056 | 1056 |
1057 /** | 1057 /** |
1058 * @private | 1058 * @private |
1059 */ | 1059 */ |
1060 FileManager.prototype.initSidebar_ = function() { | 1060 FileManager.prototype.initSidebar_ = function() { |
1061 this.directoryTree_ = this.dialogDom_.querySelector('#directory-tree'); | 1061 this.directoryTree_ = this.dialogDom_.querySelector('#directory-tree'); |
1062 DirectoryTree.decorate(this.directoryTree_, this.directoryModel_); | 1062 DirectoryTree.decorate(this.directoryTree_, this.directoryModel_); |
1063 this.directoryTree_.addEventListener('content-updated', function() { | 1063 if (util.platform.newUI()) { |
1064 this.updateMiddleBarVisibility_(true); | 1064 this.directoryTree_.addEventListener('content-updated', function() { |
1065 }.bind(this)); | 1065 this.updateMiddleBarVisibility_(true); |
1066 }.bind(this)); | |
1067 } | |
1066 if (util.platform.newUI()) { | 1068 if (util.platform.newUI()) { |
1067 this.volumeList_ = this.dialogDom_.querySelector('#volume-list'); | 1069 this.volumeList_ = this.dialogDom_.querySelector('#volume-list'); |
1068 VolumeList.decorate(this.volumeList_, this.directoryModel_); | 1070 VolumeList.decorate(this.volumeList_, this.directoryModel_); |
1069 } | 1071 } |
1070 }; | 1072 }; |
1071 | 1073 |
1072 /** | 1074 /** |
1073 * @param {boolean=} opt_delayed If true, updating is delayed by 500ms. | 1075 * @param {boolean=} opt_delayed If true, updating is delayed by 500ms. |
1074 * @private | 1076 * @private |
1075 */ | 1077 */ |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1417 g.columns = 0; | 1419 g.columns = 0; |
1418 g.redraw(); | 1420 g.redraw(); |
1419 g.endBatchUpdates(); | 1421 g.endBatchUpdates(); |
1420 }, 0); | 1422 }, 0); |
1421 } else { | 1423 } else { |
1422 if (util.platform.newUI()) { | 1424 if (util.platform.newUI()) { |
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(); | |
1428 } | 1429 } |
1429 | 1430 |
1430 if (!util.platform.newUI()) | 1431 if (!util.platform.newUI()) |
1431 this.breadcrumbs_.truncate(); | 1432 this.breadcrumbs_.truncate(); |
1433 else | |
1434 this.volumeList_.redraw(); | |
1432 | 1435 |
1433 this.searchBreadcrumbs_.truncate(); | 1436 this.searchBreadcrumbs_.truncate(); |
1434 | |
1435 this.updateWindowState_(); | 1437 this.updateWindowState_(); |
1436 }; | 1438 }; |
1437 | 1439 |
1438 /** | 1440 /** |
1439 * @private | 1441 * @private |
1440 */ | 1442 */ |
1441 FileManager.prototype.updateWindowState_ = function() { | 1443 FileManager.prototype.updateWindowState_ = function() { |
1442 util.platform.getWindowStatus(function(wnd) { | 1444 util.platform.getWindowStatus(function(wnd) { |
1443 if (wnd.state == 'maximized') { | 1445 if (wnd.state == 'maximized') { |
1444 this.dialogDom_.setAttribute('maximized', 'maximized'); | 1446 this.dialogDom_.setAttribute('maximized', 'maximized'); |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2532 if (this.scanUpdatedAtLeastOnceOrCompleted_) | 2534 if (this.scanUpdatedAtLeastOnceOrCompleted_) |
2533 return; | 2535 return; |
2534 this.scanUpdatedAtLeastOnceOrCompleted_ = true; | 2536 this.scanUpdatedAtLeastOnceOrCompleted_ = true; |
2535 this.scanInProgress_ = false; | 2537 this.scanInProgress_ = false; |
2536 if (this.scanUpdatedTimer_) { | 2538 if (this.scanUpdatedTimer_) { |
2537 clearTimeout(this.scanUpdatedTimer_); | 2539 clearTimeout(this.scanUpdatedTimer_); |
2538 this.scanUpdatedTimer_ = null; | 2540 this.scanUpdatedTimer_ = null; |
2539 } | 2541 } |
2540 this.table_.list.endBatchUpdates(); | 2542 this.table_.list.endBatchUpdates(); |
2541 this.grid_.endBatchUpdates(); | 2543 this.grid_.endBatchUpdates(); |
2542 this.updateMiddleBarVisibility_(); | 2544 if (!util.platform.newUI()) |
2545 this.updateMiddleBarVisibility_(); | |
yoshiki
2013/05/13 02:00:48
This is necessary on New UI.
mtomasz
2013/05/13 02:07:38
Fixed. Done.
| |
2543 this.scanCompletedTimer_ = null; | 2546 this.scanCompletedTimer_ = null; |
2544 }.bind(this), 50); | 2547 }.bind(this), 50); |
2545 }; | 2548 }; |
2546 | 2549 |
2547 /** | 2550 /** |
2548 * @private | 2551 * @private |
2549 */ | 2552 */ |
2550 FileManager.prototype.onScanUpdated_ = function() { | 2553 FileManager.prototype.onScanUpdated_ = function() { |
2551 if (!this.scanInProgress_) { | 2554 if (!this.scanInProgress_) { |
2552 console.error('Scan-updated event recieved. But scan is not started.'); | 2555 console.error('Scan-updated event recieved. But scan is not started.'); |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3653 * Set the flag expressing whether the ctrl key is pressed or not. | 3656 * Set the flag expressing whether the ctrl key is pressed or not. |
3654 * @param {boolean} flag New value of the flag | 3657 * @param {boolean} flag New value of the flag |
3655 * @private | 3658 * @private |
3656 */ | 3659 */ |
3657 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3660 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3658 this.ctrlKeyPressed_ = flag; | 3661 this.ctrlKeyPressed_ = flag; |
3659 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3662 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3660 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3663 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3661 }; | 3664 }; |
3662 })(); | 3665 })(); |
OLD | NEW |