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

Side by Side Diff: Source/devtools/front_end/ui/Widget.js

Issue 1172643002: DevTools: migrate sidebar pane's titleElement to use Toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 WebInspector.Widget.__assert(this._isRoot, "Attempt to attach wi dget to orphan node"); 244 WebInspector.Widget.__assert(this._isRoot, "Attempt to attach wi dget to orphan node");
245 } else if (this._visible) { 245 } else if (this._visible) {
246 return; 246 return;
247 } 247 }
248 248
249 this._visible = true; 249 this._visible = true;
250 250
251 if (this._parentIsShowing()) 251 if (this._parentIsShowing())
252 this._processWillShow(); 252 this._processWillShow();
253 253
254 this.element.classList.add("visible"); 254 this.element.classList.remove("hidden");
dgozman 2015/06/09 13:27:02 Won't this detach iframes?
pfeldman 2015/06/09 13:40:59 Nope, it is alright.
255 255
256 // Reparent 256 // Reparent
257 if (this.element.parentElement !== parentElement) { 257 if (this.element.parentElement !== parentElement) {
258 WebInspector.Widget._incrementWidgetCounter(parentElement, this.elem ent); 258 WebInspector.Widget._incrementWidgetCounter(parentElement, this.elem ent);
259 if (insertBefore) 259 if (insertBefore)
260 WebInspector.Widget._originalInsertBefore.call(parentElement, th is.element, insertBefore); 260 WebInspector.Widget._originalInsertBefore.call(parentElement, th is.element, insertBefore);
261 else 261 else
262 WebInspector.Widget._originalAppendChild.call(parentElement, thi s.element); 262 WebInspector.Widget._originalAppendChild.call(parentElement, thi s.element);
263 } 263 }
264 264
(...skipping 12 matching lines...) Expand all
277 detach: function(overrideHideOnDetach) 277 detach: function(overrideHideOnDetach)
278 { 278 {
279 var parentElement = this.element.parentElement; 279 var parentElement = this.element.parentElement;
280 if (!parentElement) 280 if (!parentElement)
281 return; 281 return;
282 282
283 if (this._parentIsShowing()) 283 if (this._parentIsShowing())
284 this._processWillHide(); 284 this._processWillHide();
285 285
286 if (!overrideHideOnDetach && this._shouldHideOnDetach()) { 286 if (!overrideHideOnDetach && this._shouldHideOnDetach()) {
287 this.element.classList.remove("visible"); 287 this.element.classList.add("hidden");
288 this._visible = false; 288 this._visible = false;
289 if (this._parentIsShowing()) 289 if (this._parentIsShowing())
290 this._processWasHidden(); 290 this._processWasHidden();
291 if (this._parentWidget && this._hasNonZeroConstraints()) 291 if (this._parentWidget && this._hasNonZeroConstraints())
292 this._parentWidget.invalidateConstraints(); 292 this._parentWidget.invalidateConstraints();
293 return; 293 return;
294 } 294 }
295 295
296 // Force legal removal 296 // Force legal removal
297 WebInspector.Widget._decrementWidgetCounter(parentElement, this.element) ; 297 WebInspector.Widget._decrementWidgetCounter(parentElement, this.element) ;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 { 676 {
677 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation"); 677 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation");
678 return WebInspector.Widget._originalRemoveChild.call(this, child); 678 return WebInspector.Widget._originalRemoveChild.call(this, child);
679 } 679 }
680 680
681 Element.prototype.removeChildren = function() 681 Element.prototype.removeChildren = function()
682 { 682 {
683 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation"); 683 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation");
684 WebInspector.Widget._originalRemoveChildren.call(this); 684 WebInspector.Widget._originalRemoveChildren.call(this);
685 } 685 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698