blob: f53646b7c554a738120011e6067da0d8e992c843 [file] [log] [blame]
// Copyright 2018 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.
/**
* @fileoverview A helper object used to open a URL in a new tab.
* the browser.
*/
export interface OpenWindowProxy {
/**
* Opens the specified URL in a new tab.
*/
openURL(url: string): void;
}
export class OpenWindowProxyImpl implements OpenWindowProxy {
openURL(url: string) {
window.open(url);
}
static getInstance(): OpenWindowProxy {
return instance || (instance = new OpenWindowProxyImpl());
}
static setInstance(obj: OpenWindowProxy) {
instance = obj;
}
}
let instance: OpenWindowProxy|null = null;