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