| 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 * @extends {WebInspector.App} | 7 * @extends {WebInspector.App} |
| 8 * @implements {WebInspector.ToolboxDelegate} | 8 * @implements {WebInspector.ToolboxDelegate} |
| 9 */ | 9 */ |
| 10 WebInspector.AdvancedApp = function() | 10 WebInspector.AdvancedApp = function() |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 if (this._toolboxWindow) | 83 if (this._toolboxWindow) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 var url = window.location.href.replace("devtools.html", "toolbox.html"); | 86 var url = window.location.href.replace("devtools.html", "toolbox.html"); |
| 87 this._toolboxWindow = window.open(url, undefined); | 87 this._toolboxWindow = window.open(url, undefined); |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * @param {!Element} rootElement | 91 * @param {!WebInspector.ResponsiveDesignView} responsiveDesignView |
| 92 * @override | 92 * @param {!WebInspector.InspectedPagePlaceholder} placeholder |
| 93 */ | 93 */ |
| 94 toolboxLoaded: function(rootElement) | 94 toolboxLoaded: function(responsiveDesignView, placeholder) |
| 95 { | 95 { |
| 96 var inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder
(); | 96 this._toolboxResponsiveDesignView = responsiveDesignView; |
| 97 inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePlac
eholder.Events.Update, this._onSetInspectedPageBounds.bind(this, true)); | 97 placeholder.addEventListener(WebInspector.InspectedPagePlaceholder.Event
s.Update, this._onSetInspectedPageBounds.bind(this, true)); |
| 98 this._toolboxResponsiveDesignView = new WebInspector.ResponsiveDesignVie
w(inspectedPagePlaceholder); | |
| 99 this._toolboxResponsiveDesignView.show(rootElement); | |
| 100 this._updatePageResizer(); | 98 this._updatePageResizer(); |
| 101 }, | 99 }, |
| 102 | 100 |
| 103 /** | |
| 104 * @return {!InspectorFrontendHostAPI} | |
| 105 */ | |
| 106 inspectorFrontendHost: function() | |
| 107 { | |
| 108 return window.InspectorFrontendHost; | |
| 109 }, | |
| 110 | |
| 111 _updatePageResizer: function() | 101 _updatePageResizer: function() |
| 112 { | 102 { |
| 113 if (this._isDocked()) | 103 if (this._isDocked()) |
| 114 this._responsiveDesignView.updatePageResizer(); | 104 this._responsiveDesignView.updatePageResizer(); |
| 115 else if (this._toolboxResponsiveDesignView) | 105 else if (this._toolboxResponsiveDesignView) |
| 116 this._toolboxResponsiveDesignView.updatePageResizer(); | 106 this._toolboxResponsiveDesignView.updatePageResizer(); |
| 117 }, | 107 }, |
| 118 | 108 |
| 119 /** | 109 /** |
| 120 * @param {!WebInspector.Event} event | 110 * @param {!WebInspector.Event} event |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 handleAction: function() | 274 handleAction: function() |
| 285 { | 275 { |
| 286 if (!WebInspector.overridesSupport.responsiveDesignAvailable()) | 276 if (!WebInspector.overridesSupport.responsiveDesignAvailable()) |
| 287 return false; | 277 return false; |
| 288 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) | 278 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) |
| 289 return false; | 279 return false; |
| 290 WebInspector.app._toggleEmulationEnabled(); | 280 WebInspector.app._toggleEmulationEnabled(); |
| 291 return true; | 281 return true; |
| 292 } | 282 } |
| 293 } | 283 } |
| OLD | NEW |