OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('settings', function() { | 5 cr.define('settings', function() { |
6 /** @interface */ | 6 /** @interface */ |
7 function LifetimeBrowserProxy() {} | 7 function LifetimeBrowserProxy() {} |
8 | 8 |
9 LifetimeBrowserProxy.prototype = { | 9 LifetimeBrowserProxy.prototype = { |
10 // Triggers a browser restart. | 10 // Triggers a browser restart. |
11 restart: function() {}, | 11 restart: function() {}, |
12 | 12 |
13 // Triggers a browser relaunch. | 13 // Triggers a browser relaunch. |
14 relaunch: function() {}, | 14 relaunch: function() {}, |
15 | 15 |
16 // <if expr="chromeos"> | 16 // <if expr="chromeos"> |
17 // First signs out current user and then performs a restart. | 17 // First signs out current user and then performs a restart. |
18 signOutAndRestart: function() {}, | 18 signOutAndRestart: function() {}, |
19 | 19 |
20 // Triggers a factory reset. | 20 // Triggers a factory reset. |
21 factoryReset: function() {}, | 21 factoryReset: function() {}, |
22 // </if> | 22 // </if> |
23 }; | 23 }; |
24 | 24 |
25 /** | 25 /** |
26 * @constructor | 26 * @constructor |
27 * @implements {settings.LifetimeBrowserProxy} | 27 * @implements {settings.LifetimeBrowserProxy} |
28 */ | 28 */ |
29 function LifetimeBrowserProxyImpl() {} | 29 function LifetimeBrowserProxyImpl() {} |
30 cr.addSingletonGetter(LifetimeBrowserProxyImpl); | 30 cr.addSingletonGetter(LifetimeBrowserProxyImpl); |
31 | 31 |
32 LifetimeBrowserProxyImpl.prototype = { | 32 LifetimeBrowserProxyImpl.prototype = { |
33 /** @override */ | 33 /** @override */ |
34 restart: function() { | 34 restart: function() { |
35 chrome.send('restart'); | 35 chrome.send('restart'); |
36 }, | 36 }, |
37 | 37 |
38 /** @override */ | 38 /** @override */ |
39 relaunch: function() { | 39 relaunch: function() { |
40 chrome.send('relaunch'); | 40 chrome.send('relaunch'); |
41 }, | 41 }, |
42 | 42 |
43 // <if expr="chromeos"> | 43 // <if expr="chromeos"> |
44 /** @override */ | 44 /** @override */ |
45 signOutAndRestart: function() { | 45 signOutAndRestart: function() { |
46 chrome.send('signOutAndRestart'); | 46 chrome.send('signOutAndRestart'); |
47 }, | 47 }, |
48 | 48 |
49 /** @override */ | 49 /** @override */ |
50 factoryReset: function() { | 50 factoryReset: function() { |
51 chrome.send('factoryReset'); | 51 chrome.send('factoryReset'); |
52 }, | 52 }, |
53 // </if> | 53 // </if> |
54 }; | 54 }; |
55 | 55 |
56 return { | 56 return { |
57 LifetimeBrowserProxy: LifetimeBrowserProxy, | 57 LifetimeBrowserProxy: LifetimeBrowserProxy, |
58 LifetimeBrowserProxyImpl: LifetimeBrowserProxyImpl, | 58 LifetimeBrowserProxyImpl: LifetimeBrowserProxyImpl, |
59 }; | 59 }; |
60 }); | 60 }); |
OLD | NEW |