1 // Copyright 2015 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.
7 * @extends {WebInspector.DialogDelegate}
9 WebInspector.DevicesDialog = function()
11 WebInspector.DialogDelegate.call(this);
12 this.element.classList.add("devices-dialog");
13 this._view = new WebInspector.DevicesView();
14 this._view.markAsRoot();
16 this._closeButton = createElementWithClass("div", "dialog-close-button", "dt-close-button");
17 this._closeButton.gray = true;
18 this._closeButton.addEventListener("click", WebInspector.Dialog.hide.bind(WebInspector.Dialog), false);
19 this.element.appendChild(this._closeButton);
22 /** @type {?WebInspector.DevicesDialog} */
23 WebInspector.DevicesDialog._instance = null;
25 WebInspector.DevicesDialog.show = function()
27 if (!WebInspector.DevicesDialog._instance)
28 WebInspector.DevicesDialog._instance = new WebInspector.DevicesDialog();
29 WebInspector.Dialog.show(null, WebInspector.DevicesDialog._instance);
32 WebInspector.DevicesDialog.prototype = {
34 * @param {!Element} element
37 show: function(element)
39 WebInspector.DialogDelegate.prototype.show.call(this, element);
40 this._view.show(this.element, this._closeButton);
48 WebInspector.DialogDelegate.prototype.willHide.call(this);
52 __proto__: WebInspector.DialogDelegate.prototype
57 * @implements {WebInspector.ActionDelegate}
59 WebInspector.DevicesDialog.ActionDelegate = function()
63 WebInspector.DevicesDialog.ActionDelegate.prototype = {
66 * @param {!WebInspector.Context} context
67 * @param {string} actionId
69 handleAction: function(context, actionId)
71 if (actionId === "devices.dialog.show")
72 WebInspector.DevicesDialog.show();