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

Side by Side Diff: Source/devtools/front_end/extensions/ExtensionPanel.js

Issue 1172643002: DevTools: migrate sidebar pane's titleElement to use Toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: only using latin1 in css Created 5 years, 6 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) 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 * * 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 setPage: function(url) 244 setPage: function(url)
245 { 245 {
246 if (this._objectPropertiesView) { 246 if (this._objectPropertiesView) {
247 this._objectPropertiesView.detach(); 247 this._objectPropertiesView.detach();
248 delete this._objectPropertiesView; 248 delete this._objectPropertiesView;
249 } 249 }
250 if (this._extensionView) 250 if (this._extensionView)
251 this._extensionView.detach(true); 251 this._extensionView.detach(true);
252 252
253 this._extensionView = new WebInspector.ExtensionView(this._server, this. _id, url, "extension fill"); 253 this._extensionView = new WebInspector.ExtensionView(this._server, this. _id, url, "extension fill");
254 this._extensionView.show(this.bodyElement); 254 this._extensionView.show(this.element);
255 255
256 if (!this.bodyElement.style.height) 256 if (!this.element.style.height)
257 this.setHeight("150px"); 257 this.setHeight("150px");
258 }, 258 },
259 259
260 /** 260 /**
261 * @param {string} height 261 * @param {string} height
262 */ 262 */
263 setHeight: function(height) 263 setHeight: function(height)
264 { 264 {
265 this.bodyElement.style.height = height; 265 this.element.style.height = height;
266 }, 266 },
267 267
268 /** 268 /**
269 * @param {string} title 269 * @param {string} title
270 * @param {function(?string=)} callback 270 * @param {function(?string=)} callback
271 * @param {?Protocol.Error} error 271 * @param {?Protocol.Error} error
272 * @param {?WebInspector.RemoteObject} result 272 * @param {?WebInspector.RemoteObject} result
273 * @param {boolean=} wasThrown 273 * @param {boolean=} wasThrown
274 */ 274 */
275 _onEvaluate: function(title, callback, error, result, wasThrown) 275 _onEvaluate: function(title, callback, error, result, wasThrown)
276 { 276 {
277 if (error) 277 if (error)
278 callback(error.toString()); 278 callback(error.toString());
279 else 279 else
280 this._setObject(/** @type {!WebInspector.RemoteObject} */ (result), title, callback); 280 this._setObject(/** @type {!WebInspector.RemoteObject} */ (result), title, callback);
281 }, 281 },
282 282
283 _createObjectPropertiesView: function() 283 _createObjectPropertiesView: function()
284 { 284 {
285 if (this._objectPropertiesView) 285 if (this._objectPropertiesView)
286 return; 286 return;
287 if (this._extensionView) { 287 if (this._extensionView) {
288 this._extensionView.detach(true); 288 this._extensionView.detach(true);
289 delete this._extensionView; 289 delete this._extensionView;
290 } 290 }
291 this._objectPropertiesView = new WebInspector.ExtensionNotifierView(this ._server, this._id); 291 this._objectPropertiesView = new WebInspector.ExtensionNotifierView(this ._server, this._id);
292 this._objectPropertiesView.show(this.bodyElement); 292 this._objectPropertiesView.show(this.element);
293 }, 293 },
294 294
295 /** 295 /**
296 * @param {!WebInspector.RemoteObject} object 296 * @param {!WebInspector.RemoteObject} object
297 * @param {string} title 297 * @param {string} title
298 * @param {function(?string=)} callback 298 * @param {function(?string=)} callback
299 */ 299 */
300 _setObject: function(object, title, callback) 300 _setObject: function(object, title, callback)
301 { 301 {
302 // This may only happen if setPage() was called while we were evaluating the expression. 302 // This may only happen if setPage() was called while we were evaluating the expression.
303 if (!this._objectPropertiesView) { 303 if (!this._objectPropertiesView) {
304 callback("operation cancelled"); 304 callback("operation cancelled");
305 return; 305 return;
306 } 306 }
307 this._objectPropertiesView.element.removeChildren(); 307 this._objectPropertiesView.element.removeChildren();
308 var section = new WebInspector.ObjectPropertiesSection(object, title); 308 var section = new WebInspector.ObjectPropertiesSection(object, title);
309 if (!title) 309 if (!title)
310 section.titleLessMode(); 310 section.titleLessMode();
311 section.expand(); 311 section.expand();
312 section.editable = false; 312 section.editable = false;
313 this._objectPropertiesView.element.appendChild(section.element); 313 this._objectPropertiesView.element.appendChild(section.element);
314 callback(); 314 callback();
315 }, 315 },
316 316
317 __proto__: WebInspector.SidebarPane.prototype 317 __proto__: WebInspector.SidebarPane.prototype
318 } 318 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/elementsPanel.css ('k') | Source/devtools/front_end/inspectorStyle.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698