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

Side by Side Diff: chrome/browser/resources/file_manager/js/file_transfer_controller.js

Issue 10342010: Add gdata content search to file_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
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 var MAX_DRAG_THUMBAIL_COUNT = 4; 5 var MAX_DRAG_THUMBAIL_COUNT = 4;
6 6
7 /** 7 /**
8 * Global (placed in the window object) variable name to hold internal 8 * Global (placed in the window object) variable name to hold internal
9 * file dragging information. Needed to show visual feedback while dragging 9 * file dragging information. Needed to show visual feedback while dragging
10 * since DataTransfer object is in protected state. Reachable from other 10 * since DataTransfer object is in protected state. Reachable from other
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // queryCommandEnabled returns true if event.returnValue is false. 421 // queryCommandEnabled returns true if event.returnValue is false.
422 event.returnValue = !this.canPasteOrDrop_(event.clipboardData); 422 event.returnValue = !this.canPasteOrDrop_(event.clipboardData);
423 }, 423 },
424 424
425 canPasteOrDrop_: function(dataTransfer, opt_destinationPath) { 425 canPasteOrDrop_: function(dataTransfer, opt_destinationPath) {
426 var destinationPath = opt_destinationPath || 426 var destinationPath = opt_destinationPath ||
427 this.directoryModel_.getCurrentDirPath(); 427 this.directoryModel_.getCurrentDirPath();
428 if (this.directoryModel_.isPathReadOnly(destinationPath)) { 428 if (this.directoryModel_.isPathReadOnly(destinationPath)) {
429 return false; 429 return false;
430 } 430 }
431 if (this.directoryModel_.isSearching())
432 return false;
431 433
432 if (!dataTransfer.types || dataTransfer.types.indexOf('fs/tag') == -1) 434 if (!dataTransfer.types || dataTransfer.types.indexOf('fs/tag') == -1)
433 return false; // Unsupported type of content. 435 return false; // Unsupported type of content.
434 if (dataTransfer.getData('fs/tag') == '') { 436 if (dataTransfer.getData('fs/tag') == '') {
435 // Data protected. Other checks are not possible but it makes sense to 437 // Data protected. Other checks are not possible but it makes sense to
436 // let the user try. 438 // let the user try.
437 return true; 439 return true;
438 } 440 }
439 441
440 var directories = dataTransfer.getData('fs/directories').split('\n'). 442 var directories = dataTransfer.getData('fs/directories').split('\n').
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 entries.filter(function(e) {return e.isDirectory}).length == 0 && 504 entries.filter(function(e) {return e.isDirectory}).length == 0 &&
503 props.filter(function(p) {return !p.availableOffline}).length == 0; 505 props.filter(function(p) {return !p.availableOffline}).length == 0;
504 // |Copy| is the only menu item affected by allGDataFilesAvailable. 506 // |Copy| is the only menu item affected by allGDataFilesAvailable.
505 // It could be open right now, update its UI. 507 // It could be open right now, update its UI.
506 this.copyCommand_.disabled = !this.canCopyOrDrag_(); 508 this.copyCommand_.disabled = !this.canCopyOrDrag_();
507 }.bind(this)); 509 }.bind(this));
508 } 510 }
509 }, 511 },
510 512
511 get currentDirectory() { 513 get currentDirectory() {
512 return this.directoryModel_.getCurrentDirEntry(); 514 return this.directoryModel_.getSearchOrCurrentDirEntry();
513 }, 515 },
514 516
515 get readonly() { 517 get readonly() {
516 return this.directoryModel_.isReadOnly(); 518 return this.directoryModel_.isReadOnly();
517 }, 519 },
518 520
519 get isOnGData() { 521 get isOnGData() {
520 return this.directoryModel_.getRootType() == DirectoryModel.RootType.GDATA; 522 return this.directoryModel_.getRootType() == DirectoryModel.RootType.GDATA;
521 }, 523 },
522 524
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 this.scrollStep_ = speed * SCROLL_INTERVAL / 1000; 579 this.scrollStep_ = speed * SCROLL_INTERVAL / 1000;
578 this.scrollList_ = list; 580 this.scrollList_ = list;
579 }, 581 },
580 582
581 scroll_: function() { 583 scroll_: function() {
582 if (this.scrollList_) 584 if (this.scrollList_)
583 this.scrollList_.scrollTop += this.scrollStep_; 585 this.scrollList_.scrollTop += this.scrollStep_;
584 } 586 }
585 }; 587 };
586 588
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | chrome/browser/resources/file_manager/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698