OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 /** | 627 /** |
628 * @this {WebInspector.NavigatorView} | 628 * @this {WebInspector.NavigatorView} |
629 * @param {?string} content | 629 * @param {?string} content |
630 */ | 630 */ |
631 function contentLoaded(content) | 631 function contentLoaded(content) |
632 { | 632 { |
633 createFile.call(this, content || ""); | 633 createFile.call(this, content || ""); |
634 } | 634 } |
635 | 635 |
636 if (uiSourceCodeToCopy) | 636 if (uiSourceCodeToCopy) |
637 uiSourceCodeToCopy.requestContent(contentLoaded.bind(this)); | 637 uiSourceCodeToCopy.requestContent().then(contentLoaded.bind(this)); |
638 else | 638 else |
639 createFile.call(this); | 639 createFile.call(this); |
640 | 640 |
641 /** | 641 /** |
642 * @this {WebInspector.NavigatorView} | 642 * @this {WebInspector.NavigatorView} |
643 * @param {string=} content | 643 * @param {string=} content |
644 */ | 644 */ |
645 function createFile(content) | 645 function createFile(content) |
646 { | 646 { |
647 project.createFile(path, null, content || "", fileCreated.bind(this)
); | 647 project.createFile(path, null, content || "", fileCreated.bind(this)
); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 this.listItemElement.draggable = true; | 858 this.listItemElement.draggable = true; |
859 this.listItemElement.addEventListener("click", this._onclick.bind(this),
false); | 859 this.listItemElement.addEventListener("click", this._onclick.bind(this),
false); |
860 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), false); | 860 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), false); |
861 this.listItemElement.addEventListener("mousedown", this._onmousedown.bin
d(this), false); | 861 this.listItemElement.addEventListener("mousedown", this._onmousedown.bin
d(this), false); |
862 this.listItemElement.addEventListener("dragstart", this._ondragstart.bin
d(this), false); | 862 this.listItemElement.addEventListener("dragstart", this._ondragstart.bin
d(this), false); |
863 }, | 863 }, |
864 | 864 |
865 _onmousedown: function(event) | 865 _onmousedown: function(event) |
866 { | 866 { |
867 if (event.which === 1) // Warm-up data for drag'n'drop | 867 if (event.which === 1) // Warm-up data for drag'n'drop |
868 this._uiSourceCode.requestContent(callback.bind(this)); | 868 this._uiSourceCode.requestContent().then(callback.bind(this)); |
869 /** | 869 /** |
870 * @param {?string} content | 870 * @param {?string} content |
871 * @this {WebInspector.NavigatorSourceTreeElement} | 871 * @this {WebInspector.NavigatorSourceTreeElement} |
872 */ | 872 */ |
873 function callback(content) | 873 function callback(content) |
874 { | 874 { |
875 this._warmedUpContent = content; | 875 this._warmedUpContent = content; |
876 } | 876 } |
877 }, | 877 }, |
878 | 878 |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 { | 1491 { |
1492 if (this._treeElement) | 1492 if (this._treeElement) |
1493 return this._treeElement; | 1493 return this._treeElement; |
1494 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); | 1494 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); |
1495 this._treeElement.setNode(this); | 1495 this._treeElement.setNode(this); |
1496 return this._treeElement; | 1496 return this._treeElement; |
1497 }, | 1497 }, |
1498 | 1498 |
1499 __proto__: WebInspector.NavigatorTreeNode.prototype | 1499 __proto__: WebInspector.NavigatorTreeNode.prototype |
1500 } | 1500 } |
OLD | NEW |