| Index: chrome/browser/resources/settings/default_browser_page/default_browser_browser_proxy.js
|
| diff --git a/chrome/browser/resources/settings/default_browser_page/default_browser_browser_proxy.js b/chrome/browser/resources/settings/default_browser_page/default_browser_browser_proxy.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e4f34daae06810c11ade0bbe69ad70a5a3ce881e
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/settings/default_browser_page/default_browser_browser_proxy.js
|
| @@ -0,0 +1,63 @@
|
| +// Copyright 2016 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.
|
| +
|
| +/**
|
| + * @fileoverview A helper object used from the "Default Browser" section
|
| + * to interact with the browser.
|
| + */
|
| +
|
| +/**
|
| + * @typedef {{
|
| + * canBeDefault: boolean,
|
| + * isDefault: boolean,
|
| + * isDisabledByPolicy: boolean,
|
| + * isUnknownError: boolean,
|
| + * }};
|
| + */
|
| +var DefaultBrowserInfo;
|
| +
|
| +cr.define('settings', function() {
|
| + /** @interface */
|
| + function DefaultBrowserBrowserProxy() {}
|
| +
|
| + DefaultBrowserBrowserProxy.prototype = {
|
| + /**
|
| + * Get the initial DefaultBrowserInfo and begin sending updates to
|
| + * 'settings.updateDefaultBrowserState'.
|
| + * @return {!Promise<DefaultBrowserInfo>}
|
| + */
|
| + requestDefaultBrowserState: function() {},
|
| +
|
| + /*
|
| + * Try to set the current browser as the default browser. The new status of
|
| + * the settings will be sent to 'settings.updateDefaultBrowserState'.
|
| + */
|
| + setAsDefaultBrowser: function() {},
|
| + };
|
| +
|
| + /**
|
| + * @constructor
|
| + * @implements {settings.DefaultBrowserBrowserProxy}
|
| + */
|
| + function DefaultBrowserBrowserProxyImpl() {}
|
| + cr.addSingletonGetter(DefaultBrowserBrowserProxyImpl);
|
| +
|
| + DefaultBrowserBrowserProxyImpl.prototype = {
|
| + /** @override */
|
| + requestDefaultBrowserState: function() {
|
| + return cr.sendWithPromise(
|
| + 'SettingsDefaultBrowser.requestDefaultBrowserState');
|
| + },
|
| +
|
| + /** @override */
|
| + setAsDefaultBrowser: function() {
|
| + chrome.send('SettingsDefaultBrowser.setAsDefaultBrowser');
|
| + },
|
| + };
|
| +
|
| + return {
|
| + DefaultBrowserBrowserProxy: DefaultBrowserBrowserProxy,
|
| + DefaultBrowserBrowserProxyImpl: DefaultBrowserBrowserProxyImpl,
|
| + };
|
| +});
|
|
|