Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1585 /** | 1585 /** |
| 1586 * @constructor | 1586 * @constructor |
| 1587 * @extends {WebInspector.View} | 1587 * @extends {WebInspector.View} |
| 1588 */ | 1588 */ |
| 1589 WebInspector.SourcesView = function() | 1589 WebInspector.SourcesView = function() |
| 1590 { | 1590 { |
| 1591 WebInspector.View.call(this); | 1591 WebInspector.View.call(this); |
| 1592 this.registerRequiredCSS("sourcesView.css"); | 1592 this.registerRequiredCSS("sourcesView.css"); |
| 1593 this.element.id = "sources-panel-sources-view"; | 1593 this.element.id = "sources-panel-sources-view"; |
| 1594 this.element.addStyleClass("vbox"); | 1594 this.element.addStyleClass("vbox"); |
| 1595 this.element.addEventListener("dragenter", this._onDragEnter.bind(this), tru e); | |
| 1596 this.element.addEventListener("dragover", this._onDragOver.bind(this), true) ; | |
| 1595 } | 1597 } |
| 1596 | 1598 |
| 1599 WebInspector.SourcesView.dragAndDropFilesType = "Files"; | |
| 1600 | |
| 1597 WebInspector.SourcesView.prototype = { | 1601 WebInspector.SourcesView.prototype = { |
| 1602 _onDragEnter: function (event) | |
| 1603 { | |
| 1604 if (event.dataTransfer.types.indexOf(WebInspector.SourcesView.dragAndDro pFilesType) === -1) | |
| 1605 return; | |
| 1606 event.consume(true); | |
| 1607 }, | |
| 1608 | |
| 1609 _onDragOver: function (event) | |
| 1610 { | |
| 1611 if (event.dataTransfer.types.indexOf(WebInspector.SourcesView.dragAndDro pFilesType) === -1) | |
| 1612 return; | |
| 1613 event.consume(true); | |
| 1614 if (this._dragMaskElement) | |
| 1615 return; | |
| 1616 this._dragMaskElement = this.element.createChild("div", "fill drag-mask" ); | |
| 1617 this._dragMaskElement.addEventListener("drop", this._onDrop.bind(this), true); | |
| 1618 this._dragMaskElement.addEventListener("dragleave", this._onDragLeave.bi nd(this), true); | |
| 1619 }, | |
| 1620 | |
| 1621 _onDrop: function (event) | |
| 1622 { | |
| 1623 event.consume(true); | |
| 1624 var items = event.dataTransfer.items; | |
| 1625 var item = /** @type {DataTransferItem} */ (items.length ? items[0] : nu ll); | |
| 1626 var entry = item.webkitGetAsEntry(); | |
| 1627 if (!entry.isDirectory) | |
| 1628 return; | |
| 1629 InspectorFrontendHost.upgradeDraggedFileSystemPermissions(entry.filesyst em); | |
|
pfeldman
2013/11/05 06:14:49
What's wrong with sendMessageToEmbedder(["upgradeD
kinuko
2013/11/05 07:46:16
toURL is not supported in DraggedFileSystem (due t
| |
| 1630 }, | |
| 1631 | |
| 1632 _onDragLeave: function (event) | |
| 1633 { | |
| 1634 event.consume(true); | |
| 1635 this._dragMaskElement.remove(); | |
| 1636 delete this._dragMaskElement; | |
| 1637 }, | |
| 1638 | |
| 1598 __proto__: WebInspector.View.prototype | 1639 __proto__: WebInspector.View.prototype |
| 1599 } | 1640 } |
| 1600 | 1641 |
| 1601 /** | 1642 /** |
| 1602 * @constructor | 1643 * @constructor |
| 1603 * @extends {WebInspector.View} | 1644 * @extends {WebInspector.View} |
| 1604 */ | 1645 */ |
| 1605 WebInspector.DrawerEditorView = function() | 1646 WebInspector.DrawerEditorView = function() |
| 1606 { | 1647 { |
| 1607 WebInspector.View.call(this); | 1648 WebInspector.View.call(this); |
| 1608 this.element.id = "drawer-editor-view"; | 1649 this.element.id = "drawer-editor-view"; |
| 1609 this.element.addStyleClass("vbox"); | 1650 this.element.addStyleClass("vbox"); |
| 1610 } | 1651 } |
| 1611 | 1652 |
| 1612 WebInspector.DrawerEditorView.prototype = { | 1653 WebInspector.DrawerEditorView.prototype = { |
| 1613 __proto__: WebInspector.View.prototype | 1654 __proto__: WebInspector.View.prototype |
| 1614 } | 1655 } |
| OLD | NEW |