| 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 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * @override | 24 * @override |
| 25 * @param {!Document} document | 25 * @param {!Document} document |
| 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.element.classList.add('root-split-widget'); | |
| 32 this._rootSplitWidget.show(rootView.element); | 31 this._rootSplitWidget.show(rootView.element); |
| 33 this._rootSplitWidget.setSidebarWidget(UI.inspectorView); | 32 this._rootSplitWidget.setSidebarWidget(UI.inspectorView); |
| 34 this._rootSplitWidget.setDefaultFocusedChild(UI.inspectorView); | 33 this._rootSplitWidget.setDefaultFocusedChild(UI.inspectorView); |
| 35 UI.inspectorView.setOwnerSplit(this._rootSplitWidget); | 34 UI.inspectorView.setOwnerSplit(this._rootSplitWidget); |
| 36 | 35 |
| 37 this._inspectedPagePlaceholder = new Emulation.InspectedPagePlaceholder(); | 36 this._inspectedPagePlaceholder = new Emulation.InspectedPagePlaceholder(); |
| 38 this._inspectedPagePlaceholder.addEventListener( | 37 this._inspectedPagePlaceholder.addEventListener( |
| 39 Emulation.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPa
geBounds.bind(this), this); | 38 Emulation.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPa
geBounds.bind(this), this); |
| 40 this._deviceModeView = new Emulation.DeviceModeWrapper(this._inspectedPagePl
aceholder); | 39 this._deviceModeView = new Emulation.DeviceModeWrapper(this._inspectedPagePl
aceholder); |
| 41 | 40 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 this._updateForDocked(/** @type {string} */ (event.data.to)); | 132 this._updateForDocked(/** @type {string} */ (event.data.to)); |
| 134 } | 133 } |
| 135 this._changingDockSide = false; | 134 this._changingDockSide = false; |
| 136 this._inspectedPagePlaceholder.update(); | 135 this._inspectedPagePlaceholder.update(); |
| 137 } | 136 } |
| 138 | 137 |
| 139 /** | 138 /** |
| 140 * @param {string} dockSide | 139 * @param {string} dockSide |
| 141 */ | 140 */ |
| 142 _updateForDocked(dockSide) { | 141 _updateForDocked(dockSide) { |
| 143 this._rootSplitWidget.setVertical(dockSide === Components.DockController.Sta
te.DockedToRight); | 142 this._rootSplitWidget.resizerElement().style.transform = |
| 143 dockSide === Components.DockController.State.DockedToRight ? |
| 144 'translateX(2px)' : |
| 145 dockSide === Components.DockController.State.DockedToLeft ? 'translateX(
-2px)' : ''; |
| 146 this._rootSplitWidget.setVertical( |
| 147 dockSide === Components.DockController.State.DockedToRight || |
| 148 dockSide === Components.DockController.State.DockedToLeft); |
| 144 this._rootSplitWidget.setSecondIsSidebar( | 149 this._rootSplitWidget.setSecondIsSidebar( |
| 145 dockSide === Components.DockController.State.DockedToRight || | 150 dockSide === Components.DockController.State.DockedToRight || |
| 146 dockSide === Components.DockController.State.DockedToBottom); | 151 dockSide === Components.DockController.State.DockedToBottom); |
| 147 this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(),
true); | 152 this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(),
true); |
| 148 this._rootSplitWidget.toggleResizer( | 153 this._rootSplitWidget.toggleResizer( |
| 149 UI.inspectorView.topResizerElement(), dockSide === Components.DockContro
ller.State.DockedToBottom); | 154 UI.inspectorView.topResizerElement(), dockSide === Components.DockContro
ller.State.DockedToBottom); |
| 150 this._rootSplitWidget.showBoth(); | 155 this._rootSplitWidget.showBoth(); |
| 151 } | 156 } |
| 152 | 157 |
| 153 _updateForUndocked() { | 158 _updateForUndocked() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 */ | 192 */ |
| 188 Emulation.AdvancedAppProvider = class { | 193 Emulation.AdvancedAppProvider = class { |
| 189 /** | 194 /** |
| 190 * @override | 195 * @override |
| 191 * @return {!Common.App} | 196 * @return {!Common.App} |
| 192 */ | 197 */ |
| 193 createApp() { | 198 createApp() { |
| 194 return Emulation.AdvancedApp._instance(); | 199 return Emulation.AdvancedApp._instance(); |
| 195 } | 200 } |
| 196 }; | 201 }; |
| OLD | NEW |