blob: 7dc6c8ee49db9880c7414128f56eed2d187eac79 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
cr.define('downloads', function() {
class BrowserProxy {
constructor() {
/** @type {downloads.mojom.PageCallbackRouter} */
this.callbackRouter = new downloads.mojom.PageCallbackRouter();
/** @type {downloads.mojom.PageHandlerProxy} */
this.handler = new downloads.mojom.PageHandlerProxy();
const factory = downloads.mojom.PageHandlerFactory.getProxy();
factory.createPageHandler(
this.callbackRouter.createProxy(), this.handler.$.createRequest());
}
}
cr.addSingletonGetter(BrowserProxy);
return {BrowserProxy: BrowserProxy};
});