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

Unified Diff: chrome/browser/resources/chromeos/login/bubble.js

Issue 7607019: [ChromeOS] Reset Gaia UI and show error if needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_view.cc ('k') | chrome/browser/resources/chromeos/login/oobe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/bubble.js
diff --git a/chrome/browser/resources/chromeos/login/bubble.js b/chrome/browser/resources/chromeos/login/bubble.js
index 7b1bf2fab2cbf58c60cd2be401f4afee27fbf6a3..248762317436f3d665c283d2b6c2d96f021d4595 100644
--- a/chrome/browser/resources/chromeos/login/bubble.js
+++ b/chrome/browser/resources/chromeos/login/bubble.js
@@ -33,23 +33,20 @@ cr.define('cr.ui', function() {
/**
* Shows the bubble for given anchor element.
- * @param {!HTMLElement} el Anchor element of the bubble.
+ * @param {number} x X position of bubble's reference point.
+ * @param {number} y Y position of bubble's reference point.
* @param {HTMLElement} content Content to show in bubble.
* @public
*/
- showContentForElement: function(el, content) {
+ showContentAt: function(x, y, content) {
const ARROW_OFFSET = 14;
- const HORIZONTAL_PADDING = 10;
- const VERTICAL_PADDING = 5;
- var elementOrigin = Oobe.getOffset(el);
- var anchorX = elementOrigin.left + HORIZONTAL_PADDING - ARROW_OFFSET;
- var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING;
+ var anchorX = x - ARROW_OFFSET;
+ var anchorY = y;
this.style.left = anchorX + 'px';
this.style.top = anchorY + 'px';
- this.anchor_ = el;
this.innerHTML = '';
this.appendChild(content);
this.hidden = false;
@@ -59,6 +56,24 @@ cr.define('cr.ui', function() {
/**
* Shows the bubble for given anchor element.
* @param {!HTMLElement} el Anchor element of the bubble.
+ * @param {HTMLElement} content Content to show in bubble.
+ * @public
+ */
+ showContentForElement: function(el, content) {
+ const HORIZONTAL_PADDING = 10;
+ const VERTICAL_PADDING = 5;
+
+ var elementOrigin = Oobe.getOffset(el);
+ var anchorX = elementOrigin.left + HORIZONTAL_PADDING;
+ var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING;
+
+ this.anchor_ = el;
+ this.showContentAt(anchorX, anchorY, content);
+ },
+
+ /**
+ * Shows the bubble for given anchor element.
+ * @param {!HTMLElement} el Anchor element of the bubble.
* @param {string} text Text content to show in bubble.
* @public
*/
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_view.cc ('k') | chrome/browser/resources/chromeos/login/oobe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698