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

Unified Diff: chrome/browser/resources/local_ntp/local_ntp.js

Issue 623603002: [Local NTP] Fixing middle click paste in fakebox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responded to commit Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698