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

Side by Side Diff: Source/devtools/front_end/sdk/DOMModel.js

Issue 397303002: DevTools: [Elements] Implement shortcut-based node cut-copy-pasting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add visual feedback for nodes in the clipboard Created 6 years, 5 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 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 }, 449 },
450 450
451 /** 451 /**
452 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback 452 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
453 */ 453 */
454 removeNode: function(callback) 454 removeNode: function(callback)
455 { 455 {
456 this._agent.removeNode(this.id, this._domModel._markRevision(this, callb ack)); 456 this._agent.removeNode(this.id, this._domModel._markRevision(this, callb ack));
457 }, 457 },
458 458
459 copyNode: function() 459 /**
460 * @param {function(?string)=} callback
461 */
462 copyNode: function(callback)
460 { 463 {
461 function copy(error, text) 464 function copy(error, text)
462 { 465 {
466 if (callback) {
aandrey 2014/07/18 05:30:05 call the callback after the copyText?
apavlov 2014/07/18 09:02:08 The idea here was that if we have a callback, the
467 callback(error ? null : text);
468 return;
469 }
463 if (!error) 470 if (!error)
464 InspectorFrontendHost.copyText(text); 471 InspectorFrontendHost.copyText(text);
465 } 472 }
466 this._agent.getOuterHTML(this.id, copy); 473 this._agent.getOuterHTML(this.id, copy);
467 }, 474 },
468 475
469 /** 476 /**
470 * @param {string} objectGroupId 477 * @param {string} objectGroupId
471 * @param {function(?Array.<!WebInspector.DOMModel.EventListener>)} callback 478 * @param {function(?Array.<!WebInspector.DOMModel.EventListener>)} callback
472 */ 479 */
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 var attr = this._attributesMap[name]; 707 var attr = this._attributesMap[name];
701 if (attr) { 708 if (attr) {
702 this._attributes.remove(attr); 709 this._attributes.remove(attr);
703 delete this._attributesMap[name]; 710 delete this._attributesMap[name];
704 } 711 }
705 }, 712 },
706 713
707 /** 714 /**
708 * @param {!WebInspector.DOMNode} targetNode 715 * @param {!WebInspector.DOMNode} targetNode
709 * @param {?WebInspector.DOMNode} anchorNode 716 * @param {?WebInspector.DOMNode} anchorNode
717 * @param {boolean} deep
718 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
719 */
720 copyTo: function(targetNode, anchorNode, deep, callback)
721 {
722 this._agent.copyTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, deep, this._domModel._markRevision(this, callback));
723 },
724
725 /**
726 * @param {!WebInspector.DOMNode} targetNode
727 * @param {?WebInspector.DOMNode} anchorNode
710 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback 728 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
711 */ 729 */
712 moveTo: function(targetNode, anchorNode, callback) 730 moveTo: function(targetNode, anchorNode, callback)
713 { 731 {
714 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback)); 732 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
715 }, 733 },
716 734
717 /** 735 /**
718 * @return {boolean} 736 * @return {boolean}
719 */ 737 */
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 * @param {boolean} inspectUAShadowDOM 1945 * @param {boolean} inspectUAShadowDOM
1928 * @param {!DOMAgent.HighlightConfig} config 1946 * @param {!DOMAgent.HighlightConfig} config
1929 * @param {function(?Protocol.Error)=} callback 1947 * @param {function(?Protocol.Error)=} callback
1930 */ 1948 */
1931 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 1949 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k)
1932 { 1950 {
1933 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); 1951 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled);
1934 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 1952 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback);
1935 } 1953 }
1936 } 1954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698