| Index: chrome/browser/resources/md_bookmarks/dnd_chip.js
|
| diff --git a/chrome/browser/resources/md_bookmarks/dnd_chip.js b/chrome/browser/resources/md_bookmarks/dnd_chip.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..41bd9426dba3e8f562413820a23bddf2b676b6b8
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/md_bookmarks/dnd_chip.js
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +Polymer({
|
| + is: 'bookmarks-dnd-chip',
|
| +
|
| + properties: {
|
| + /** @private */
|
| + showing_: {
|
| + type: Boolean,
|
| + reflectToAttribute: true,
|
| + },
|
| +
|
| + /** @private */
|
| + isFolder_: Boolean,
|
| + },
|
| +
|
| + /**
|
| + * @param {number} x
|
| + * @param {number} y
|
| + * @param {!Array<BookmarkNode>} items
|
| + */
|
| + showForItems: function(x, y, items) {
|
| + this.style.setProperty('--mouse-x', x + 'px');
|
| + this.style.setProperty('--mouse-y', y + 'px');
|
| +
|
| + if (this.showing_)
|
| + return;
|
| +
|
| + var firstItem = items[0];
|
| + this.isFolder_ = !firstItem.url;
|
| + // TODO(calamity): handle multi-item UI.
|
| + if (firstItem.url)
|
| + this.$.icon.style.backgroundImage = cr.icon.getFavicon(firstItem.url);
|
| +
|
| + this.$.title.textContent = firstItem.title;
|
| + this.showing_ = true;
|
| + },
|
| +
|
| + hide: function() {
|
| + this.showing_ = false;
|
| + },
|
| +});
|
|
|