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

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: Simplified code by using |clipboardData.getData| Created 6 years, 2 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..3db2d43f07c293e864418b8003eb58aa96f6ebd7 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,10 @@ function init() {
if (inputbox) {
inputbox.onpaste = function(event) {
event.preventDefault();
- searchboxApiHandle.paste();
+ // Send pasted text to Omnibox.
+ var text = event.clipboardData.getData('text/plain');
+ 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