| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @implements {WebInspector.Console.UIDelegate} |
| 7 */ | 8 */ |
| 8 WebInspector.App = function() | 9 WebInspector.App = function() |
| 9 { | 10 { |
| 10 if (WebInspector.overridesSupport.responsiveDesignAvailable()) { | 11 if (WebInspector.overridesSupport.responsiveDesignAvailable()) { |
| 11 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspec
tor.UIString("Toggle device mode."), "emulation-status-bar-item"); | 12 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspec
tor.UIString("Toggle device mode."), "emulation-status-bar-item"); |
| 12 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.emul
ationEnabled(); | 13 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.emul
ationEnabled(); |
| 13 this._toggleEmulationButton.addEventListener("click", this._toggleEmulat
ionEnabled, this); | 14 this._toggleEmulationButton.addEventListener("click", this._toggleEmulat
ionEnabled, this); |
| 14 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.EmulationStateChanged, this._emulationEnabledChanged, this); | 15 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.EmulationStateChanged, this._emulationEnabledChanged, this); |
| 15 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); | 16 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); |
| 16 } | 17 } |
| 18 WebInspector.console.setUIDelegate(this); |
| 17 }; | 19 }; |
| 18 | 20 |
| 19 WebInspector.App.prototype = { | 21 WebInspector.App.prototype = { |
| 20 _toggleEmulationEnabled: function() | 22 _toggleEmulationEnabled: function() |
| 21 { | 23 { |
| 22 WebInspector.overridesSupport.setEmulationEnabled(!this._toggleEmulation
Button.toggled); | 24 WebInspector.overridesSupport.setEmulationEnabled(!this._toggleEmulation
Button.toggled); |
| 23 }, | 25 }, |
| 24 | 26 |
| 25 _emulationEnabledChanged: function() | 27 _emulationEnabledChanged: function() |
| 26 { | 28 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 * @param {!WebInspector.Target} mainTarget | 48 * @param {!WebInspector.Target} mainTarget |
| 47 */ | 49 */ |
| 48 presentUI: function(mainTarget) | 50 presentUI: function(mainTarget) |
| 49 { | 51 { |
| 50 WebInspector.inspectorView.showInitialPanel(); | 52 WebInspector.inspectorView.showInitialPanel(); |
| 51 | 53 |
| 52 WebInspector.overridesSupport.applyInitialOverrides(); | 54 WebInspector.overridesSupport.applyInitialOverrides(); |
| 53 if (!WebInspector.overridesSupport.responsiveDesignAvailable() && WebIns
pector.overridesSupport.emulationEnabled()) | 55 if (!WebInspector.overridesSupport.responsiveDesignAvailable() && WebIns
pector.overridesSupport.emulationEnabled()) |
| 54 WebInspector.inspectorView.showViewInDrawer("emulation", true); | 56 WebInspector.inspectorView.showViewInDrawer("emulation", true); |
| 55 this._overridesWarningUpdated(); | 57 this._overridesWarningUpdated(); |
| 58 }, |
| 59 |
| 60 showConsole: function() |
| 61 { |
| 62 WebInspector.Revealer.reveal(WebInspector.console); |
| 56 } | 63 } |
| 57 }; | 64 }; |
| 58 | 65 |
| 59 /** | 66 /** |
| 60 * @constructor | 67 * @constructor |
| 61 * @implements {WebInspector.StatusBarButton.Provider} | 68 * @implements {WebInspector.StatusBarButton.Provider} |
| 62 */ | 69 */ |
| 63 WebInspector.App.EmulationButtonProvider = function() | 70 WebInspector.App.EmulationButtonProvider = function() |
| 64 { | 71 { |
| 65 } | 72 } |
| 66 | 73 |
| 67 WebInspector.App.EmulationButtonProvider.prototype = { | 74 WebInspector.App.EmulationButtonProvider.prototype = { |
| 68 /** | 75 /** |
| 69 * @return {?WebInspector.StatusBarButton} | 76 * @return {?WebInspector.StatusBarButton} |
| 70 */ | 77 */ |
| 71 button: function() | 78 button: function() |
| 72 { | 79 { |
| 73 if (!(WebInspector.app instanceof WebInspector.App)) | 80 if (!(WebInspector.app instanceof WebInspector.App)) |
| 74 return null; | 81 return null; |
| 75 return WebInspector.app._toggleEmulationButton || null; | 82 return WebInspector.app._toggleEmulationButton || null; |
| 76 } | 83 } |
| 77 } | 84 } |
| 78 | 85 |
| 79 /** | 86 /** |
| 80 * @type {!WebInspector.App} | 87 * @type {!WebInspector.App} |
| 81 */ | 88 */ |
| 82 WebInspector.app; | 89 WebInspector.app; |
| OLD | NEW |