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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 2778283002: [DevTools] Do not inherit SDK.DOMNode from SDK.SDKObject (Closed)
Patch Set: Created 3 years, 8 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return; 508 return;
509 509
510 if (!this._searchConfig || this._searchConfig.query !== query) 510 if (!this._searchConfig || this._searchConfig.query !== query)
511 this.searchCanceled(); 511 this.searchCanceled();
512 else 512 else
513 this._hideSearchHighlights(); 513 this._hideSearchHighlights();
514 514
515 this._searchConfig = searchConfig; 515 this._searchConfig = searchConfig;
516 516
517 var promises = []; 517 var promises = [];
518 var domModels = SDK.DOMModel.instances(); 518 var domModels = SDK.targetManager.models(SDK.DOMModel);
519 for (var domModel of domModels) { 519 for (var domModel of domModels) {
520 promises.push( 520 promises.push(
521 domModel.performSearchPromise(whitespaceTrimmedQuery, Common.moduleSet ting('showUAShadowDOM').get())); 521 domModel.performSearchPromise(whitespaceTrimmedQuery, Common.moduleSet ting('showUAShadowDOM').get()));
522 } 522 }
523 Promise.all(promises).then(resultCountCallback.bind(this)); 523 Promise.all(promises).then(resultCountCallback.bind(this));
524 524
525 /** 525 /**
526 * @param {!Array.<number>} resultCounts 526 * @param {!Array.<number>} resultCounts
527 * @this {Elements.ElementsPanel} 527 * @this {Elements.ElementsPanel}
528 */ 528 */
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 if (!link) 578 if (!link)
579 return null; 579 return null;
580 580
581 return { 581 return {
582 box: link.boxInWindow(), 582 box: link.boxInWindow(),
583 show: async popover => { 583 show: async popover => {
584 var node = this.selectedDOMNode(); 584 var node = this.selectedDOMNode();
585 if (!node) 585 if (!node)
586 return false; 586 return false;
587 var preview = await Components.DOMPresentationUtils.buildImagePreviewCon tents( 587 var preview = await Components.DOMPresentationUtils.buildImagePreviewCon tents(
588 node.target(), link[Elements.ElementsTreeElement.HrefSymbol], true); 588 node.domModel().target(), link[Elements.ElementsTreeElement.HrefSymb ol], true);
589 if (preview) 589 if (preview)
590 popover.contentElement.appendChild(preview); 590 popover.contentElement.appendChild(preview);
591 return !!preview; 591 return !!preview;
592 } 592 }
593 }; 593 };
594 } 594 }
595 595
596 _jumpToSearchResult(index) { 596 _jumpToSearchResult(index) {
597 this._currentSearchResultIndex = (index + this._searchResults.length) % this ._searchResults.length; 597 this._currentSearchResultIndex = (index + this._searchResults.length) % this ._searchResults.length;
598 this._highlightCurrentSearchResult(); 598 this._highlightCurrentSearchResult();
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 */ 1095 */
1096 Elements.ElementsPanel.PseudoStateMarkerDecorator = class { 1096 Elements.ElementsPanel.PseudoStateMarkerDecorator = class {
1097 /** 1097 /**
1098 * @override 1098 * @override
1099 * @param {!SDK.DOMNode} node 1099 * @param {!SDK.DOMNode} node
1100 * @return {?{title: string, color: string}} 1100 * @return {?{title: string, color: string}}
1101 */ 1101 */
1102 decorate(node) { 1102 decorate(node) {
1103 return { 1103 return {
1104 color: 'orange', 1104 color: 'orange',
1105 title: Common.UIString('Element state: %s', ':' + SDK.CSSModel.fromNode(no de).pseudoState(node).join(', :')) 1105 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel ().pseudoState(node).join(', :'))
1106 }; 1106 };
1107 } 1107 }
1108 }; 1108 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698