| 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 * @implements {Common.App} | 5 * @implements {Common.App} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Emulation.AdvancedApp = class { | 8 Emulation.AdvancedApp = class { |
| 9 constructor() { | 9 constructor() { |
| 10 Components.dockController.addEventListener( | 10 Components.dockController.addEventListener( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 presentUI(document) { | 27 presentUI(document) { |
| 28 var rootView = new UI.RootView(); | 28 var rootView = new UI.RootView(); |
| 29 | 29 |
| 30 this._rootSplitWidget = new UI.SplitWidget(false, true, 'InspectorView.split
ViewState', 555, 300, true); | 30 this._rootSplitWidget = new UI.SplitWidget(false, true, 'InspectorView.split
ViewState', 555, 300, true); |
| 31 this._rootSplitWidget.show(rootView.element); | 31 this._rootSplitWidget.show(rootView.element); |
| 32 this._rootSplitWidget.setSidebarWidget(UI.inspectorView); | 32 this._rootSplitWidget.setSidebarWidget(UI.inspectorView); |
| 33 this._rootSplitWidget.setDefaultFocusedChild(UI.inspectorView); | 33 this._rootSplitWidget.setDefaultFocusedChild(UI.inspectorView); |
| 34 UI.inspectorView.setOwnerSplit(this._rootSplitWidget); | 34 UI.inspectorView.setOwnerSplit(this._rootSplitWidget); |
| 35 | 35 |
| 36 this._inspectedPagePlaceholder = new Emulation.InspectedPagePlaceholder(); | 36 this._inspectedPagePlaceholder = Emulation.InspectedPagePlaceholder.instance
(); |
| 37 this._inspectedPagePlaceholder.addEventListener( | 37 this._inspectedPagePlaceholder.addEventListener( |
| 38 Emulation.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPa
geBounds.bind(this), this); | 38 Emulation.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPa
geBounds.bind(this), this); |
| 39 this._deviceModeView = new Emulation.DeviceModeWrapper(this._inspectedPagePl
aceholder); | 39 this._deviceModeView = new Emulation.DeviceModeWrapper(this._inspectedPagePl
aceholder); |
| 40 | 40 |
| 41 Components.dockController.addEventListener( | 41 Components.dockController.addEventListener( |
| 42 Components.DockController.Events.BeforeDockSideChanged, this._onBeforeDo
ckSideChange, this); | 42 Components.DockController.Events.BeforeDockSideChanged, this._onBeforeDo
ckSideChange, this); |
| 43 Components.dockController.addEventListener( | 43 Components.dockController.addEventListener( |
| 44 Components.DockController.Events.DockSideChanged, this._onDockSideChange
, this); | 44 Components.DockController.Events.DockSideChanged, this._onDockSideChange
, this); |
| 45 Components.dockController.addEventListener( | 45 Components.dockController.addEventListener( |
| 46 Components.DockController.Events.AfterDockSideChanged, this._onAfterDock
SideChange, this); | 46 Components.DockController.Events.AfterDockSideChanged, this._onAfterDock
SideChange, this); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 * @param {!Common.Event} event | 169 * @param {!Common.Event} event |
| 170 */ | 170 */ |
| 171 _onSetInspectedPageBounds(event) { | 171 _onSetInspectedPageBounds(event) { |
| 172 if (this._changingDockSide) | 172 if (this._changingDockSide) |
| 173 return; | 173 return; |
| 174 var window = this._inspectedPagePlaceholder.element.window(); | 174 var window = this._inspectedPagePlaceholder.element.window(); |
| 175 if (!window.innerWidth || !window.innerHeight) | 175 if (!window.innerWidth || !window.innerHeight) |
| 176 return; | 176 return; |
| 177 if (!this._inspectedPagePlaceholder.isShowing()) | 177 if (!this._inspectedPagePlaceholder.isShowing()) |
| 178 return; | 178 return; |
| 179 var bounds = /** @type {{x: number, y: number, width: number, height: number
}} */ (event.data); | 179 var bounds = |
| 180 /** @type {{x: number, y: number, width: number, height: number, force:
(boolean|undefined)}} */ (event.data); |
| 181 var force = bounds.force || false; |
| 182 delete bounds.force; |
| 180 console.timeStamp('AdvancedApp.setInspectedPageBounds'); | 183 console.timeStamp('AdvancedApp.setInspectedPageBounds'); |
| 181 InspectorFrontendHost.setInspectedPageBounds(bounds); | 184 InspectorFrontendHost.setInspectedPageBounds(bounds, force); |
| 182 } | 185 } |
| 183 }; | 186 }; |
| 184 | 187 |
| 185 /** @type {!Emulation.AdvancedApp} */ | 188 /** @type {!Emulation.AdvancedApp} */ |
| 186 Emulation.AdvancedApp._appInstance; | 189 Emulation.AdvancedApp._appInstance; |
| 187 | 190 |
| 188 | 191 |
| 189 /** | 192 /** |
| 190 * @implements {Common.AppProvider} | 193 * @implements {Common.AppProvider} |
| 191 * @unrestricted | 194 * @unrestricted |
| 192 */ | 195 */ |
| 193 Emulation.AdvancedAppProvider = class { | 196 Emulation.AdvancedAppProvider = class { |
| 194 /** | 197 /** |
| 195 * @override | 198 * @override |
| 196 * @return {!Common.App} | 199 * @return {!Common.App} |
| 197 */ | 200 */ |
| 198 createApp() { | 201 createApp() { |
| 199 return Emulation.AdvancedApp._instance(); | 202 return Emulation.AdvancedApp._instance(); |
| 200 } | 203 } |
| 201 }; | 204 }; |
| OLD | NEW |