Index: chrome/browser/resources/omnibox/omnibox.js |
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js |
index 8ce8fe006470bf9737341c5b10357df8a4946d2d..96ad0ca68873404f976be8c28b4f1320c685ed51 100644 |
--- a/chrome/browser/resources/omnibox/omnibox.js |
+++ b/chrome/browser/resources/omnibox/omnibox.js |
@@ -17,13 +17,14 @@ |
* are available, the Javascript formats them and displays them. |
*/ |
define('main', [ |
+ 'mojo/public/js/bindings', |
+ 'mojo/public/js/core', |
'mojo/public/js/connection', |
'chrome/browser/ui/webui/omnibox/omnibox.mojom', |
'content/public/renderer/service_provider', |
-], function(connector, browser, serviceProvider) { |
+], function(bindings, core, connection, browser, serviceProvider) { |
'use strict'; |
- var connection; |
var page; |
/** |
@@ -71,12 +72,17 @@ define('main', [ |
// - forth element: the value of prefer-keyword |
// - fifth element: the value of page-classification |
cursorPositionUsed = $('input-text').selectionEnd; |
+ var pipe = core.createMessagePipe(); |
+ var stub = connection.bindHandleToStub(pipe.handle0, browser.OmniboxPage); |
+ bindings.StubBindings(stub).delegate = page; |
+ page.stub_ = stub; |
page.browser_.startOmniboxQuery( |
$('input-text').value, |
cursorPositionUsed, |
$('prevent-inline-autocomplete').checked, |
$('prefer-keyword').checked, |
- parseInt($('page-classification').value)); |
+ parseInt($('page-classification').value), |
+ pipe.handle1); |
// Cancel the submit action. i.e., don't submit the form. (We handle |
// display the results solely with Javascript.) |
event.preventDefault(); |
@@ -421,7 +427,6 @@ define('main', [ |
function OmniboxPageImpl(browser) { |
this.browser_ = browser; |
- page = this; |
initialize(); |
} |
@@ -434,10 +439,10 @@ define('main', [ |
}; |
return function() { |
- connection = new connector.Connection( |
+ var browserProxy = connection.bindHandleToProxy( |
serviceProvider.connectToService( |
browser.OmniboxUIHandlerMojo.name), |
- OmniboxPageImpl, |
- browser.OmniboxUIHandlerMojo.proxyClass); |
+ browser.OmniboxUIHandlerMojo); |
+ page = new OmniboxPageImpl(browserProxy); |
}; |
}); |