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

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: Addressing comments. 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..4390e04a128f7d012ad78924925c7a7639500888
--- /dev/null
+++ b/chrome/browser/resources/settings/reset_page/reset_browser_proxy.js
@@ -0,0 +1,89 @@
+// 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 the user gave consent to upload
+ * broken settings to Google for analysis.
+ * @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