Chromium Code Reviews| Index: chrome/browser/resources/settings/reset_page/reset_browser_proxy.js |
| diff --git a/chrome/browser/resources/settings/reset_page/reset_browser_proxy.js b/chrome/browser/resources/settings/reset_page/reset_browser_proxy.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..be7229e66a10e333b353d2eaf4e71c6fc02bba6a |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/reset_page/reset_browser_proxy.js |
| @@ -0,0 +1,88 @@ |
| +// 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. |
| + |
| +cr.define('settings', function() { |
| + /** @interface */ |
| + function ResetBrowserProxy() {} |
| + |
| + ResetBrowserProxy.prototype = { |
| + /** |
| + * @param {boolean} sendSettings Whether to report the settings. |
|
tommycli
2016/04/05 18:46:28
nit: and this can be in a separate CL, but the nam
dpapad
2016/04/05 19:23:12
No, it is whether the settings that are being rese
|
| + * @return {!Promise} A promise firing once resetting has completed. |
| + */ |
| + performResetProfileSettings: function(sendSettings) {}, |
| + |
| + /** |
| + * A method to be called when the reset profile dialog is hidden. |
| + */ |
| + onHideResetProfileDialog: function() {}, |
| + |
| + /** |
| + * A method to be called when the reset profile banner is hidden. |
| + */ |
| + onHideResetProfileBanner: function() {}, |
| + |
| + /** |
| + * A method to be called when the reset profile dialog is shown. |
| + */ |
| + onShowResetProfileDialog: function() {}, |
| + |
| +<if expr="chromeos"> |
| + /** |
| + * A method to be called when the reset powerwash dialog is shown. |
| + */ |
| + onPowerwashDialogShow: function() {}, |
| + |
| + /** |
| + * Initiates a factory reset and restarts ChromeOS. |
| + */ |
| + requestFactoryResetRestart: function() {}, |
| +</if> |
| + }; |
| + |
| + /** |
| + * @constructor |
| + * @implements {settings.ResetBrowserProxy} |
| + */ |
| + function ResetBrowserProxyImpl() {} |
| + cr.addSingletonGetter(ResetBrowserProxyImpl); |
| + |
| + ResetBrowserProxyImpl.prototype = { |
| + /** @override */ |
| + performResetProfileSettings: function(sendSettings) { |
| + return cr.sendWithPromise('performResetProfileSettings', sendSettings); |
| + }, |
| + |
| + /** @override */ |
| + onHideResetProfileDialog: function() { |
| + chrome.send('onHideResetProfileDialog'); |
| + }, |
| + |
| + /** @override */ |
| + onHideResetProfileBanner: function() { |
| + chrome.send('onHideResetProfileBanner'); |
| + }, |
| + |
| + /** @override */ |
| + onShowResetProfileDialog: function() { |
| + chrome.send('onShowResetProfileDialog'); |
| + }, |
| + |
| +<if expr="chromeos"> |
| + /** @override */ |
| + onPowerwashDialogShow: function() { |
| + chrome.send('onPowerwashDialogShow'); |
| + }, |
| + |
| + /** @override */ |
| + requestFactoryResetRestart: function() { |
| + chrome.send('requestFactoryResetRestart'); |
| + }, |
| +</if> |
| + }; |
| + |
| + return { |
| + ResetBrowserProxyImpl: ResetBrowserProxyImpl, |
| + }; |
| +}); |