| OLD | NEW |
| (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 LifetimeBrowserProxy() {} |
| 8 |
| 9 LifetimeBrowserProxy.prototype = { |
| 10 // Triggers a browser restart. |
| 11 restart: function() {}, |
| 12 |
| 13 // Triggers a browser relaunch. |
| 14 relaunch: function() {}, |
| 15 |
| 16 <if expr="chromeos"> |
| 17 // First signs out current user and then performs a restart. |
| 18 logOutAndRestart: function() {}, |
| 19 |
| 20 // Triggers a factory reset. |
| 21 factoryReset: function() {}, |
| 22 </if> |
| 23 }; |
| 24 |
| 25 /** |
| 26 * @constructor |
| 27 * @implements {settings.LifetimeBrowserProxy} |
| 28 */ |
| 29 function LifetimeBrowserProxyImpl() {} |
| 30 cr.addSingletonGetter(LifetimeBrowserProxyImpl); |
| 31 |
| 32 LifetimeBrowserProxyImpl.prototype = { |
| 33 /** @override */ |
| 34 restart: function() { |
| 35 chrome.send('restart'); |
| 36 }, |
| 37 |
| 38 /** @override */ |
| 39 relaunch: function() { |
| 40 chrome.send('relaunch'); |
| 41 }, |
| 42 |
| 43 <if expr="chromeos"> |
| 44 /** @override */ |
| 45 logOutAndRestart: function() { |
| 46 chrome.send('logOutAndRestart'); |
| 47 }, |
| 48 |
| 49 /** @override */ |
| 50 factoryReset: function() { |
| 51 chrome.send('factoryReset'); |
| 52 }, |
| 53 </if> |
| 54 }; |
| 55 |
| 56 return { |
| 57 LifetimeBrowserProxy: LifetimeBrowserProxy, |
| 58 LifetimeBrowserProxyImpl: LifetimeBrowserProxyImpl, |
| 59 }; |
| 60 }); |
| OLD | NEW |