OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.DialogDelegate} | 7 * @extends {WebInspector.DialogDelegate} |
8 */ | 8 */ |
9 WebInspector.DevicesDialog = function() | 9 WebInspector.DevicesDialog = function() |
10 { | 10 { |
11 WebInspector.DialogDelegate.call(this); | 11 WebInspector.DialogDelegate.call(this); |
12 this.element.classList.add("devices-dialog"); | 12 this.element.classList.add("devices-dialog"); |
13 this._view = new WebInspector.DevicesView(); | 13 this._view = new WebInspector.DevicesView(); |
14 this._view.markAsRoot(); | 14 this._view.markAsRoot(); |
15 | 15 |
16 this._closeButton = createElementWithClass("div", "dialog-close-button", "dt
-close-button"); | 16 this._closeButton = createElementWithClass("div", "dialog-close-button", "dt
-close-button"); |
17 this._closeButton.gray = true; | 17 this._closeButton.gray = true; |
18 this._closeButton.addEventListener("click", WebInspector.Dialog.hide.bind(We
bInspector.Dialog), false); | 18 this._closeButton.addEventListener("click", WebInspector.Dialog.hide.bind(We
bInspector.Dialog), false); |
19 this.element.appendChild(this._closeButton); | 19 this.element.appendChild(this._closeButton); |
20 } | 20 } |
21 | 21 |
22 /** @type {?WebInspector.DevicesDialog} */ | 22 /** @type {?WebInspector.DevicesDialog} */ |
23 WebInspector.DevicesDialog._instance = null; | 23 WebInspector.DevicesDialog._instance = null; |
24 | 24 |
25 WebInspector.DevicesDialog.show = function() | 25 WebInspector.DevicesDialog.show = function() |
26 { | 26 { |
27 if (!WebInspector.DevicesDialog._instance) | 27 if (!WebInspector.DevicesDialog._instance) |
28 WebInspector.DevicesDialog._instance = new WebInspector.DevicesDialog(); | 28 WebInspector.DevicesDialog._instance = new WebInspector.DevicesDialog(); |
29 WebInspector.Dialog.show(null, WebInspector.DevicesDialog._instance); | 29 WebInspector.Dialog.show(WebInspector.DevicesDialog._instance); |
30 } | 30 } |
31 | 31 |
32 WebInspector.DevicesDialog.prototype = { | 32 WebInspector.DevicesDialog.prototype = { |
33 /** | 33 /** |
34 * @param {!Element} element | 34 * @param {!Element} element |
35 * @override | 35 * @override |
36 */ | 36 */ |
37 show: function(element) | 37 show: function(element) |
38 { | 38 { |
39 WebInspector.DialogDelegate.prototype.show.call(this, element); | 39 WebInspector.DialogDelegate.prototype.show.call(this, element); |
(...skipping 25 matching lines...) Expand all Loading... |
65 * @override | 65 * @override |
66 * @param {!WebInspector.Context} context | 66 * @param {!WebInspector.Context} context |
67 * @param {string} actionId | 67 * @param {string} actionId |
68 */ | 68 */ |
69 handleAction: function(context, actionId) | 69 handleAction: function(context, actionId) |
70 { | 70 { |
71 if (actionId === "devices.dialog.show") | 71 if (actionId === "devices.dialog.show") |
72 WebInspector.DevicesDialog.show(); | 72 WebInspector.DevicesDialog.show(); |
73 } | 73 } |
74 } | 74 } |
OLD | NEW |