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

Unified Diff: chrome/browser/resources/settings/reset_page/reset_browser_proxy.js

Issue 1853413002: MD Settings: Convert reset_page/ to use browser proxy pattern. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS tests. Created 4 years, 8 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
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,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698