Chromium Code Reviews| Index: chrome/browser/resources/local_ntp/local_ntp.js |
| diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js |
| index b8f60bf8977499af0d527a8bd672afb113ea2177..d5cec07bef24913f7ea892a0564d5826f4074be4 100644 |
| --- a/chrome/browser/resources/local_ntp/local_ntp.js |
| +++ b/chrome/browser/resources/local_ntp/local_ntp.js |
| @@ -1081,9 +1081,9 @@ function init() { |
| fakebox = document.createElement('div'); |
| fakebox.id = IDS.FAKEBOX; |
| var fakeboxHtml = []; |
| + fakeboxHtml.push('<div id="' + IDS.FAKEBOX_TEXT + '"></div>'); |
| fakeboxHtml.push('<input id="' + IDS.FAKEBOX_INPUT + |
| '" autocomplete="off" tabindex="-1" type="url" aria-hidden="true">'); |
| - fakeboxHtml.push('<div id="' + IDS.FAKEBOX_TEXT + '"></div>'); |
| fakeboxHtml.push('<div id="cursor"></div>'); |
| fakebox.innerHTML = fakeboxHtml.join(''); |
| @@ -1154,7 +1154,15 @@ function init() { |
| if (inputbox) { |
| inputbox.onpaste = function(event) { |
| event.preventDefault(); |
| - searchboxApiHandle.paste(); |
| + // Send pasted text to Omnibox. |
|
Mathieu
2014/10/02 19:10:30
nit: "Get the contents of the clipboard and explic
|
| + var items = event.clipboardData.items; |
| + if (items.length > 0 && items[0].type == 'text/plain') { |
|
Mathieu
2014/10/02 19:10:30
nit: if (items.length && ...
|
| + items[0].getAsString(function(text) { |
| + if (text) { |
| + searchboxApiHandle.paste(text); |
| + } |
| + }); |
| + } |
| }; |
| inputbox.ondrop = function(event) { |
| event.preventDefault(); |