summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/searchbox_extension.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 23:09:04 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 23:09:04 +0000
commit0d5ab150cfde6fdd4ff9d9927e0d95c2b570257c (patch)
tree9fa160adddc028a57d15c4a70224482e4148ac72 /chrome/renderer/searchbox_extension.cc
parent363b20dfaba03c94adbe6992e34cdba9226a07fb (diff)
downloadchromium_src-0d5ab150cfde6fdd4ff9d9927e0d95c2b570257c.zip
chromium_src-0d5ab150cfde6fdd4ff9d9927e0d95c2b570257c.tar.gz
chromium_src-0d5ab150cfde6fdd4ff9d9927e0d95c2b570257c.tar.bz2
Makes chrome pass down the length of text as the end of the
selection for instant queries. At some point I'll wire through the actual cursor position, but this is better than what we had. BUG=none TEST=none Review URL: http://codereview.chromium.org/6363001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/searchbox_extension.cc')
-rw-r--r--chrome/renderer/searchbox_extension.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/renderer/searchbox_extension.cc b/chrome/renderer/searchbox_extension.cc
index 2e26864..d58d36f 100644
--- a/chrome/renderer/searchbox_extension.cc
+++ b/chrome/renderer/searchbox_extension.cc
@@ -73,14 +73,13 @@ static const char kResizeEventName[] = "chrome.searchBox.onresize";
// Script sent as the user is typing and the provider supports instant.
// Params:
// . the text the user typed.
-// TODO: add support for the 3rd param. '46' forces the server to give us
-// verbatim results.
+// '46' forces the server to give us verbatim results.
static const char kUserInputScript[] =
"if (window.chrome.userInput)"
" window.chrome.userInput("
" window.chrome.searchBox.value,"
" window.chrome.searchBox.verbatim ? 46 : 0,"
- " 0);";
+ " window.chrome.searchBox.selectionStart);";
// Script sent when the page is committed and the provider supports instant.
// Params: