| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var TopMidBottomView = (function() { | 5 var TopMidBottomView = (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 // We inherit from View. | 8 // We inherit from View. |
| 9 var superClass = View; | 9 var superClass = View; |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 var bottombarHeight = 0; | 54 var bottombarHeight = 0; |
| 55 if (this.bottomView_) | 55 if (this.bottomView_) |
| 56 bottombarHeight = this.bottomView_.getHeight(); | 56 bottombarHeight = this.bottomView_.getHeight(); |
| 57 var middleboxHeight = height - (topbarHeight + bottombarHeight); | 57 var middleboxHeight = height - (topbarHeight + bottombarHeight); |
| 58 if (middleboxHeight < 0) | 58 if (middleboxHeight < 0) |
| 59 middleboxHeight = 0; | 59 middleboxHeight = 0; |
| 60 | 60 |
| 61 // Position the boxes using calculated split points. | 61 // Position the boxes using calculated split points. |
| 62 if (this.topView_) | 62 if (this.topView_) |
| 63 this.topView_.setGeometry(left, top, width, topbarHeight); | 63 this.topView_.setGeometry(left, top, width, topbarHeight); |
| 64 this.midView_.setGeometry(left, top + topbarHeight, width, | 64 this.midView_.setGeometry( |
| 65 middleboxHeight); | 65 left, top + topbarHeight, width, middleboxHeight); |
| 66 if (this.bottomView_) { | 66 if (this.bottomView_) { |
| 67 this.bottomView_.setGeometry(left, top + topbarHeight + middleboxHeight, | 67 this.bottomView_.setGeometry( |
| 68 width, bottombarHeight); | 68 left, top + topbarHeight + middleboxHeight, width, bottombarHeight); |
| 69 } | 69 } |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 show: function(isVisible) { | 72 show: function(isVisible) { |
| 73 superClass.prototype.show.call(this, isVisible); | 73 superClass.prototype.show.call(this, isVisible); |
| 74 if (this.topView_) | 74 if (this.topView_) |
| 75 this.topView_.show(isVisible); | 75 this.topView_.show(isVisible); |
| 76 this.midView_.show(isVisible); | 76 this.midView_.show(isVisible); |
| 77 if (this.bottomView_) | 77 if (this.bottomView_) |
| 78 this.bottomView_.show(isVisible); | 78 this.bottomView_.show(isVisible); |
| 79 } | 79 } |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 return TopMidBottomView; | 82 return TopMidBottomView; |
| 83 })(); | 83 })(); |
| OLD | NEW |