OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
6 * @fileoverview Behavior for handling display layout, specifically | 6 * @fileoverview Behavior for handling display layout, specifically |
7 * edge snapping and collisions. | 7 * edge snapping and collisions. |
8 */ | 8 */ |
9 | 9 |
10 /** @polymerBehavior */ | 10 /** @polymerBehavior */ |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 /** | 202 /** |
203 * @param {string} displayId | 203 * @param {string} displayId |
204 * @param {!chrome.system.display.Bounds|undefined} bounds | 204 * @param {!chrome.system.display.Bounds|undefined} bounds |
205 * @private | 205 * @private |
206 */ | 206 */ |
207 setCalculatedDisplayBounds_: function(displayId, bounds) { | 207 setCalculatedDisplayBounds_: function(displayId, bounds) { |
208 assert(bounds); | 208 assert(bounds); |
209 this.calculatedBoundsMap_.set( | 209 this.calculatedBoundsMap_.set( |
210 displayId, | 210 displayId, |
211 /** @type {!chrome.system.display.Bounds} */ ( | 211 /** @type {!chrome.system.display.Bounds} */ |
212 Object.assign({}, bounds))); | 212 (Object.assign({}, bounds))); |
213 }, | 213 }, |
214 | 214 |
215 /** | 215 /** |
216 * Re-parents all entries in |orphanIds| and any children. | 216 * Re-parents all entries in |orphanIds| and any children. |
217 * @param {!Array<string>} orphanIds The list of ids affected by the move. | 217 * @param {!Array<string>} orphanIds The list of ids affected by the move. |
218 * @private | 218 * @private |
219 */ | 219 */ |
220 updateOrphans_: function(orphanIds) { | 220 updateOrphans_: function(orphanIds) { |
221 var orphans = orphanIds.slice(); | 221 var orphans = orphanIds.slice(); |
222 for (var i = 0; i < orphanIds.length; ++i) { | 222 for (var i = 0; i < orphanIds.length; ++i) { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 highlight == chrome.system.display.LayoutPosition.LEFT); | 705 highlight == chrome.system.display.LayoutPosition.LEFT); |
706 div.classList.toggle( | 706 div.classList.toggle( |
707 'highlight-top', | 707 'highlight-top', |
708 highlight == chrome.system.display.LayoutPosition.TOP); | 708 highlight == chrome.system.display.LayoutPosition.TOP); |
709 div.classList.toggle( | 709 div.classList.toggle( |
710 'highlight-bottom', | 710 'highlight-bottom', |
711 highlight == chrome.system.display.LayoutPosition.BOTTOM); | 711 highlight == chrome.system.display.LayoutPosition.BOTTOM); |
712 } | 712 } |
713 }, | 713 }, |
714 }; | 714 }; |
OLD | NEW |