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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('settings', function() {
6 /** @interface */
7 function ResetBrowserProxy() {}
8
9 ResetBrowserProxy.prototype = {
10 /**
11 * @param {boolean} sendSettings Whether the user gave consent to upload
12 * broken settings to Google for analysis.
13 * @return {!Promise} A promise firing once resetting has completed.
14 */
15 performResetProfileSettings: function(sendSettings) {},
16
17 /**
18 * A method to be called when the reset profile dialog is hidden.
19 */
20 onHideResetProfileDialog: function() {},
21
22 /**
23 * A method to be called when the reset profile banner is hidden.
24 */
25 onHideResetProfileBanner: function() {},
26
27 /**
28 * A method to be called when the reset profile dialog is shown.
29 */
30 onShowResetProfileDialog: function() {},
31
32 <if expr="chromeos">
33 /**
34 * A method to be called when the reset powerwash dialog is shown.
35 */
36 onPowerwashDialogShow: function() {},
37
38 /**
39 * Initiates a factory reset and restarts ChromeOS.
40 */
41 requestFactoryResetRestart: function() {},
42 </if>
43 };
44
45 /**
46 * @constructor
47 * @implements {settings.ResetBrowserProxy}
48 */
49 function ResetBrowserProxyImpl() {}
50 cr.addSingletonGetter(ResetBrowserProxyImpl);
51
52 ResetBrowserProxyImpl.prototype = {
53 /** @override */
54 performResetProfileSettings: function(sendSettings) {
55 return cr.sendWithPromise('performResetProfileSettings', sendSettings);
56 },
57
58 /** @override */
59 onHideResetProfileDialog: function() {
60 chrome.send('onHideResetProfileDialog');
61 },
62
63 /** @override */
64 onHideResetProfileBanner: function() {
65 chrome.send('onHideResetProfileBanner');
66 },
67
68 /** @override */
69 onShowResetProfileDialog: function() {
70 chrome.send('onShowResetProfileDialog');
71 },
72
73 <if expr="chromeos">
74 /** @override */
75 onPowerwashDialogShow: function() {
76 chrome.send('onPowerwashDialogShow');
77 },
78
79 /** @override */
80 requestFactoryResetRestart: function() {
81 chrome.send('requestFactoryResetRestart');
82 },
83 </if>
84 };
85
86 return {
87 ResetBrowserProxyImpl: ResetBrowserProxyImpl,
88 };
89 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698