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

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

Issue 882883006: Remove Client= relationship in omnibox.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | chrome/browser/ui/webui/omnibox/omnibox.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
});
« no previous file with comments | « no previous file | chrome/browser/ui/webui/omnibox/omnibox.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698