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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 if (project.type() === WebInspector.projectTypes.FileSystem) { | 543 if (project.type() === WebInspector.projectTypes.FileSystem) { |
544 var parentURL = uiSourceCode.parentURL(); | 544 var parentURL = uiSourceCode.parentURL(); |
545 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202
6"), this._handleContextMenuRename.bind(this, uiSourceCode)); | 545 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202
6"), this._handleContextMenuRename.bind(this, uiSourceCode)); |
546 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop
y\u2026"), this._handleContextMenuCreate.bind(this, project, parentURL, uiSource
Code)); | 546 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop
y\u2026"), this._handleContextMenuCreate.bind(this, project, parentURL, uiSource
Code)); |
547 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t
his._handleContextMenuDelete.bind(this, uiSourceCode)); | 547 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t
his._handleContextMenuDelete.bind(this, uiSourceCode)); |
548 contextMenu.appendSeparator(); | 548 contextMenu.appendSeparator(); |
549 } | 549 } |
550 | 550 |
551 contextMenu.show(); | 551 contextMenu.show(); |
552 }, | 552 }, |
553 | 553 _requestAppBanner: function(agent) |
| 554 { |
| 555 agent.requestAppBanner(); |
| 556 }, |
554 /** | 557 /** |
555 * @param {!Event} event | 558 * @param {!Event} event |
556 * @param {!WebInspector.NavigatorFolderTreeNode} node | 559 * @param {!WebInspector.NavigatorFolderTreeNode} node |
557 */ | 560 */ |
558 handleFolderContextMenu: function(event, node) | 561 handleFolderContextMenu: function(event, node) |
559 { | 562 { |
560 var path = node._folderPath; | 563 var path = node._folderPath; |
561 var project = node._project; | 564 var project = node._project; |
562 | 565 |
563 var contextMenu = new WebInspector.ContextMenu(event); | 566 var contextMenu = new WebInspector.ContextMenu(event); |
564 | 567 if (node.parent.isRoot()) { |
| 568 var target = WebInspector.NetworkProject.targetForProject(project); |
| 569 if (target.isPage()) { |
| 570 contextMenu.appendItem(WebInspector.UIString.capitalize("Request app
banner"), this._requestAppBanner.bind(this, target.pageAgent())); |
| 571 } |
| 572 } |
565 if (project && project.type() === WebInspector.projectTypes.FileSystem)
{ | 573 if (project && project.type() === WebInspector.projectTypes.FileSystem)
{ |
566 contextMenu.appendItem(WebInspector.UIString.capitalize("Refresh"),
this._handleContextMenuRefresh.bind(this, project, path)); | 574 contextMenu.appendItem(WebInspector.UIString.capitalize("Refresh"),
this._handleContextMenuRefresh.bind(this, project, path)); |
567 if (node instanceof WebInspector.NavigatorFolderTreeNode) { | 575 if (node instanceof WebInspector.NavigatorFolderTreeNode) { |
568 contextMenu.appendItem(WebInspector.UIString.capitalize("New ^fi
le"), this._handleContextMenuCreate.bind(this, project, path)); | 576 contextMenu.appendItem(WebInspector.UIString.capitalize("New ^fi
le"), this._handleContextMenuCreate.bind(this, project, path)); |
569 contextMenu.appendItem(WebInspector.UIString.capitalize("Exclude
^folder"), this._handleContextMenuExclude.bind(this, project, path)); | 577 contextMenu.appendItem(WebInspector.UIString.capitalize("Exclude
^folder"), this._handleContextMenuExclude.bind(this, project, path)); |
570 } | 578 } |
571 } | 579 } |
572 contextMenu.appendSeparator(); | 580 contextMenu.appendSeparator(); |
573 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); | 581 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); |
574 | 582 |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 { | 1499 { |
1492 if (this._treeElement) | 1500 if (this._treeElement) |
1493 return this._treeElement; | 1501 return this._treeElement; |
1494 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); | 1502 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); |
1495 this._treeElement.setNode(this); | 1503 this._treeElement.setNode(this); |
1496 return this._treeElement; | 1504 return this._treeElement; |
1497 }, | 1505 }, |
1498 | 1506 |
1499 __proto__: WebInspector.NavigatorTreeNode.prototype | 1507 __proto__: WebInspector.NavigatorTreeNode.prototype |
1500 } | 1508 } |
OLD | NEW |