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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPopoverHelper.js

Issue 2712063002: [DevTools] Migrate Popover to GlassPane (Closed)
Patch Set: nit Created 3 years, 9 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (result.subtype === 'node') { 142 if (result.subtype === 'node') {
143 SDK.DOMModel.highlightObjectAsDOMNode(result); 143 SDK.DOMModel.highlightObjectAsDOMNode(result);
144 this._resultHighlightedAsDOM = true; 144 this._resultHighlightedAsDOM = true;
145 } 145 }
146 146
147 if (result.customPreview()) { 147 if (result.customPreview()) {
148 var customPreviewComponent = new ObjectUI.CustomPreviewComponent(resul t); 148 var customPreviewComponent = new ObjectUI.CustomPreviewComponent(resul t);
149 customPreviewComponent.expandIfPossible(); 149 customPreviewComponent.expandIfPossible();
150 popoverContentElement = customPreviewComponent.element; 150 popoverContentElement = customPreviewComponent.element;
151 } else { 151 } else {
152 popoverContentElement = createElement('div'); 152 popoverContentElement = createElementWithClass('div', 'object-popover- content');
153 UI.appendStyle(popoverContentElement, 'object_ui/objectPopover.css'); 153 UI.appendStyle(popoverContentElement, 'object_ui/objectPopover.css');
154 this._titleElement = popoverContentElement.createChild('div', 'monospa ce object-popover-title'); 154 var titleElement = popoverContentElement.createChild('div', 'monospace object-popover-title');
155 this._titleElement.createChild('span').textContent = description; 155 titleElement.createChild('span').textContent = description;
156 var section = new ObjectUI.ObjectPropertiesSection(result, '', this._l azyLinkifier()); 156 var section = new ObjectUI.ObjectPropertiesSection(result, '', this._l azyLinkifier());
157 section.element.classList.add('object-popover-tree'); 157 section.element.classList.add('object-popover-tree');
158 section.titleLessMode(); 158 section.titleLessMode();
159 popoverContentElement.appendChild(section.element); 159 popoverContentElement.appendChild(section.element);
160 } 160 }
161 var popoverWidth = 300; 161 popover.setMaxContentSize(new UI.Size(300, 250));
162 var popoverHeight = 250; 162 popover.setSizeBehavior(UI.GlassPane.SizeBehavior.SetMaxSize);
163 popover.showForAnchor(popoverContentElement, anchorElement, popoverWidth , popoverHeight); 163 popover.showForAnchor(popoverContentElement, anchorElement);
164 } 164 }
165 } 165 }
166 this._disposed = false; 166 this._disposed = false;
167 this._queryObject(element, didQueryObject.bind(this), this._popoverObjectGro up); 167 this._queryObject(element, didQueryObject.bind(this), this._popoverObjectGro up);
168 } 168 }
169 169
170 _onHideObjectPopover() { 170 _onHideObjectPopover() {
171 this._disposed = true; 171 this._disposed = true;
172 if (this._resultHighlightedAsDOM) { 172 if (this._resultHighlightedAsDOM) {
173 SDK.DOMModel.hideDOMNodeHighlight(); 173 SDK.DOMModel.hideDOMNodeHighlight();
(...skipping 15 matching lines...) Expand all
189 * @return {!Components.Linkifier} 189 * @return {!Components.Linkifier}
190 */ 190 */
191 _lazyLinkifier() { 191 _lazyLinkifier() {
192 if (!this._linkifier) 192 if (!this._linkifier)
193 this._linkifier = new Components.Linkifier(); 193 this._linkifier = new Components.Linkifier();
194 return this._linkifier; 194 return this._linkifier;
195 } 195 }
196 }; 196 };
197 197
198 ObjectUI.ObjectPopoverHelper.MaxPopoverTextLength = 10000; 198 ObjectUI.ObjectPopoverHelper.MaxPopoverTextLength = 10000;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698