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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on https://codereview.chromium.org/1571633002/ Created 4 years, 11 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
OLDNEW
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 if (project.type() === WebInspector.projectTypes.FileSystem) { 487 if (project.type() === WebInspector.projectTypes.FileSystem) {
488 var path = uiSourceCode.parentPath(); 488 var path = uiSourceCode.parentPath();
489 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202 6"), this._handleContextMenuRename.bind(this, uiSourceCode)); 489 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202 6"), this._handleContextMenuRename.bind(this, uiSourceCode));
490 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop y\u2026"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode) ); 490 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop y\u2026"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode) );
491 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t his._handleContextMenuDelete.bind(this, uiSourceCode)); 491 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t his._handleContextMenuDelete.bind(this, uiSourceCode));
492 contextMenu.appendSeparator(); 492 contextMenu.appendSeparator();
493 } 493 }
494 494
495 contextMenu.show(); 495 contextMenu.show();
496 }, 496 },
497 497 _openAppBanner: function(agent)
498 {
499 agent.openAppBanner();
500 },
498 /** 501 /**
499 * @param {!Event} event 502 * @param {!Event} event
500 * @param {!WebInspector.NavigatorFolderTreeNode} node 503 * @param {!WebInspector.NavigatorFolderTreeNode} node
501 */ 504 */
502 handleFolderContextMenu: function(event, node) 505 handleFolderContextMenu: function(event, node)
503 { 506 {
504 var path = node._folderPath; 507 var path = node._folderPath;
505 var project = node._project; 508 var project = node._project;
506 509
507 var contextMenu = new WebInspector.ContextMenu(event); 510 var contextMenu = new WebInspector.ContextMenu(event);
508 511 if (node.parent.isRoot()) {
512 var target = WebInspector.NetworkProject.targetForProject(project);
513 if (target.isPage()) {
514 contextMenu.appendItem(WebInspector.UIString.capitalize("Open app ba nner"), this._openAppBanner.bind(this, target.pageAgent()));
pfeldman 2016/01/14 04:43:05 I think this item should go into the device mode t
horo 2016/01/15 10:00:22 Implemented in DeviceModeView. But I think DeviceM
515 }
516 }
509 if (project && project.type() === WebInspector.projectTypes.FileSystem) { 517 if (project && project.type() === WebInspector.projectTypes.FileSystem) {
510 contextMenu.appendItem(WebInspector.UIString.capitalize("Refresh"), this._handleContextMenuRefresh.bind(this, project, path)); 518 contextMenu.appendItem(WebInspector.UIString.capitalize("Refresh"), this._handleContextMenuRefresh.bind(this, project, path));
511 if (node instanceof WebInspector.NavigatorFolderTreeNode) { 519 if (node instanceof WebInspector.NavigatorFolderTreeNode) {
512 contextMenu.appendItem(WebInspector.UIString.capitalize("New ^fi le"), this._handleContextMenuCreate.bind(this, project, path)); 520 contextMenu.appendItem(WebInspector.UIString.capitalize("New ^fi le"), this._handleContextMenuCreate.bind(this, project, path));
513 contextMenu.appendItem(WebInspector.UIString.capitalize("Exclude ^folder"), this._handleContextMenuExclude.bind(this, project, path)); 521 contextMenu.appendItem(WebInspector.UIString.capitalize("Exclude ^folder"), this._handleContextMenuExclude.bind(this, project, path));
514 } 522 }
515 } 523 }
516 contextMenu.appendSeparator(); 524 contextMenu.appendSeparator();
517 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); 525 WebInspector.NavigatorView.appendAddFolderItem(contextMenu);
518 526
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 { 1489 {
1482 if (this._treeElement) 1490 if (this._treeElement)
1483 return this._treeElement; 1491 return this._treeElement;
1484 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na vigatorView, this._type, this._title); 1492 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na vigatorView, this._type, this._title);
1485 this._treeElement.setNode(this); 1493 this._treeElement.setNode(this);
1486 return this._treeElement; 1494 return this._treeElement;
1487 }, 1495 },
1488 1496
1489 __proto__: WebInspector.NavigatorTreeNode.prototype 1497 __proto__: WebInspector.NavigatorTreeNode.prototype
1490 } 1498 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698