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 ab514dfeb1f0c07205ffa45495031cf3daead90c..7d0ff2338e6f9288c84a9dbcbfa6165eabb99519 100644 |
--- a/chrome/browser/resources/local_ntp/local_ntp.js |
+++ b/chrome/browser/resources/local_ntp/local_ntp.js |
@@ -55,6 +55,7 @@ var IDS = { |
ATTRIBUTION_TEXT: 'attribution-text', |
CUSTOM_THEME_STYLE: 'ct-style', |
FAKEBOX: 'fakebox', |
+ FAKEBOX_INPUT: 'fakebox-input', |
LOGO: 'logo', |
NOTIFICATION: 'mv-notice', |
NOTIFICATION_CLOSE_BUTTON: 'mv-notice-x', |
@@ -947,7 +948,8 @@ function init() { |
fakebox = document.createElement('div'); |
fakebox.id = IDS.FAKEBOX; |
fakebox.innerHTML = |
- '<input autocomplete="off" tabindex="-1" aria-hidden="true">' + |
+ '<input id="' + IDS.FAKEBOX_INPUT + |
+ '" autocomplete="off" tabindex="-1" aria-hidden="true">' + |
'<div id=cursor></div>'; |
ntpContents.insertBefore(fakebox, ntpContents.firstChild); |
@@ -1011,7 +1013,7 @@ function init() { |
if (fakebox) { |
// Listener for updating the key capture state. |
- document.body.onclick = function(event) { |
+ document.body.onmousedown = function(event) { |
if (isFakeboxClick(event)) |
searchboxApiHandle.startCapturingKeyStrokes(); |
else if (isFakeboxFocused()) |
@@ -1020,6 +1022,13 @@ function init() { |
searchboxApiHandle.onkeycapturechange = function() { |
setFakeboxFocus(searchboxApiHandle.isKeyCaptureEnabled); |
}; |
+ var inputbox = $(IDS.FAKEBOX_INPUT); |
+ if (inputbox) { |
+ inputbox.onpaste = function(event) { |
+ event.preventDefault(); |
+ searchboxApiHandle.paste(); |
+ }; |
+ } |
} |
if (searchboxApiHandle.rtl) { |