| // 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. |
| export interface LifetimeBrowserProxy { |
| // Triggers a browser restart. |
| // Triggers a browser relaunch. |
| // First signs out current user and then performs a restart. |
| signOutAndRestart(): void; |
| * Triggers a factory reset. The parameter indicates whether to install a |
| * TPM firmware update (if available) after the reset. |
| factoryReset(requestTpmFirmwareUpdate: boolean): void; |
| export class LifetimeBrowserProxyImpl implements LifetimeBrowserProxy { |
| chrome.send('signOutAndRestart'); |
| factoryReset(requestTpmFirmwareUpdate: boolean) { |
| chrome.send('factoryReset', [requestTpmFirmwareUpdate]); |
| static getInstance(): LifetimeBrowserProxy { |
| return instance || (instance = new LifetimeBrowserProxyImpl()); |
| static setInstance(obj: LifetimeBrowserProxy) { |
| let instance: LifetimeBrowserProxy|null = null; |