| 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 /** | 5 /** |
| 6 * @fileoverview Bubble implementation. | 6 * @fileoverview Bubble implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 // TODO(xiyuan): Move this into shared. | 9 // TODO(xiyuan): Move this into shared. |
| 10 cr.define('cr.ui', function() { | 10 cr.define('cr.ui', function() { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 /** | 56 /** |
| 57 * Shows the bubble for given anchor element. | 57 * Shows the bubble for given anchor element. |
| 58 * @param {!HTMLElement} el Anchor element of the bubble. | 58 * @param {!HTMLElement} el Anchor element of the bubble. |
| 59 * @param {HTMLElement} content Content to show in bubble. | 59 * @param {HTMLElement} content Content to show in bubble. |
| 60 * @public | 60 * @public |
| 61 */ | 61 */ |
| 62 showContentForElement: function(el, content) { | 62 showContentForElement: function(el, content) { |
| 63 const HORIZONTAL_PADDING = 10; | 63 const HORIZONTAL_PADDING = 10; |
| 64 const VERTICAL_PADDING = 5; | 64 const VERTICAL_PADDING = 5; |
| 65 | 65 |
| 66 var elementOrigin = Oobe.getOffset(el); | 66 var elementOrigin = cr.ui.login.DisplayManager.getOffset(el); |
| 67 var anchorX = elementOrigin.left + HORIZONTAL_PADDING; | 67 var anchorX = elementOrigin.left + HORIZONTAL_PADDING; |
| 68 var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING; | 68 var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING; |
| 69 | 69 |
| 70 this.anchor_ = el; | 70 this.anchor_ = el; |
| 71 this.showContentAt(anchorX, anchorY, content); | 71 this.showContentAt(anchorX, anchorY, content); |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * Shows the bubble for given anchor element. | 75 * Shows the bubble for given anchor element. |
| 76 * @param {!HTMLElement} el Anchor element of the bubble. | 76 * @param {!HTMLElement} el Anchor element of the bubble. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 handleDocKeyDown_: function(e) { | 120 handleDocKeyDown_: function(e) { |
| 121 if (!this.hidden) | 121 if (!this.hidden) |
| 122 this.hide(); | 122 this.hide(); |
| 123 } | 123 } |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 return { | 126 return { |
| 127 Bubble: Bubble | 127 Bubble: Bubble |
| 128 }; | 128 }; |
| 129 }); | 129 }); |
| OLD | NEW |