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

Unified Diff: chrome/browser/resources/settings/lifetime_browser_proxy.js

Issue 2057593003: MD Settings: Add dedicated C++ handler for restart/relaunch/powerwash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 4 years, 6 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/lifetime_browser_proxy.js
diff --git a/chrome/browser/resources/settings/lifetime_browser_proxy.js b/chrome/browser/resources/settings/lifetime_browser_proxy.js
new file mode 100644
index 0000000000000000000000000000000000000000..1d16ccf93d22e5301535bc25f15c4c78b7e3e6ac
--- /dev/null
+++ b/chrome/browser/resources/settings/lifetime_browser_proxy.js
@@ -0,0 +1,60 @@
+// 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 LifetimeBrowserProxy() {}
+
+ LifetimeBrowserProxy.prototype = {
+ // Triggers a browser restart.
+ restart: function() {},
+
+ // Triggers a browser relaunch.
+ relaunch: function() {},
+
+<if expr="chromeos">
+ // First signs out current user and then performs a restart.
+ logOutAndRestart: function() {},
+
+ // Triggers a factory reset.
+ factoryReset: function() {},
+</if>
+ };
+
+ /**
+ * @constructor
+ * @implements {settings.LifetimeBrowserProxy}
+ */
+ function LifetimeBrowserProxyImpl() {}
+ cr.addSingletonGetter(LifetimeBrowserProxyImpl);
+
+ LifetimeBrowserProxyImpl.prototype = {
+ /** @override */
+ restart: function() {
+ chrome.send('restart');
+ },
+
+ /** @override */
+ relaunch: function() {
+ chrome.send('relaunch');
+ },
+
+<if expr="chromeos">
+ /** @override */
+ logOutAndRestart: function() {
+ chrome.send('logOutAndRestart');
+ },
+
+ /** @override */
+ factoryReset: function() {
+ chrome.send('factoryReset');
+ },
+</if>
+ };
+
+ return {
+ LifetimeBrowserProxy: LifetimeBrowserProxy,
+ LifetimeBrowserProxyImpl: LifetimeBrowserProxyImpl,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698