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..a6f4725b21ad85d5f1dffe7d7332cc4f3469b112 |
--- /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, |
+ * }}; |
Finnur
2016/09/07 16:25:22
nit: Should this be indented?
dschuyler
2016/09/07 18:51:42
Done.
|
+ */ |
+var DefaultBrowserInfo; |
+ |
+cr.define('settings', function() { |
+ /** @interface */ |
+ function DefaultBrowserBrowserProxy() {} |
+ |
+ DefaultBrowserBrowserProxy.prototype = { |
+ /** |
+ * Get the initial DefaultBrowserInfo and begin sending updates to |
+ * 'settings.updateDefaultBrowserState'. |
Finnur
2016/09/07 16:25:22
nit: Same question here... I don't remember us ind
dschuyler
2016/09/07 18:51:42
Done.
|
+ * @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'. |
Finnur
2016/09/07 16:25:22
ditto
dschuyler
2016/09/07 18:51:42
Done.
|
+ */ |
+ 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, |
+ }; |
+}); |