OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @constructor |
| 7 * @extends {WebInspector.App} |
| 8 */ |
| 9 WebInspector.ScreencastApp = function() |
| 10 { |
| 11 WebInspector.App.call(this); |
| 12 |
| 13 this._currentScreencastState = WebInspector.settings.createSetting("currentS
creencastState", ""); |
| 14 this._lastScreencastState = WebInspector.settings.createSetting("lastScreenc
astState", ""); |
| 15 this._toggleScreencastButton = new WebInspector.StatusBarStatesSettingButton
( |
| 16 "screencast-status-bar-item", |
| 17 ["disabled", "left", "top"], |
| 18 [WebInspector.UIString("Disable screencast."), WebInspector.UIString("Sw
itch to portrait screencast."), WebInspector.UIString("Switch to landscape scree
ncast.")], |
| 19 this._currentScreencastState, |
| 20 this._lastScreencastState, |
| 21 this._onStatusBarButtonStateChanged.bind(this)); |
| 22 }; |
| 23 |
| 24 WebInspector.ScreencastApp.prototype = { |
| 25 createGlobalStatusBarItems: function() |
| 26 { |
| 27 this.appendInspectStatusBarItem(); |
| 28 this.appendSettingsStatusBarItem(); |
| 29 WebInspector.inspectorView.appendToRightToolbar(this._toggleScreencastBu
tton.element); |
| 30 }, |
| 31 |
| 32 createRootView: function() |
| 33 { |
| 34 var rootView = new WebInspector.RootView(); |
| 35 |
| 36 this._rootSplitView = new WebInspector.SplitView(false, true, "Inspector
View.screencastSplitViewState", 300, 300); |
| 37 this._rootSplitView.show(rootView.element); |
| 38 |
| 39 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); |
| 40 var target = /** @type {!WebInspector.Target} */ (WebInspector.targetMan
ager.activeTarget()); |
| 41 this._screencastView = new WebInspector.ScreencastView(target); |
| 42 this._screencastView.show(this._rootSplitView.mainElement()); |
| 43 |
| 44 this._onStatusBarButtonStateChanged("disabled"); |
| 45 rootView.attachToBody(); |
| 46 }, |
| 47 |
| 48 presentUI: function() |
| 49 { |
| 50 WebInspector.App.prototype.presentUI.call(this); |
| 51 this._screencastView.initialize(); |
| 52 this._toggleScreencastButton.toggleInitialState(); |
| 53 }, |
| 54 |
| 55 /** |
| 56 * @param {string} state |
| 57 */ |
| 58 _onStatusBarButtonStateChanged: function(state) |
| 59 { |
| 60 if (state === "disabled") { |
| 61 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement
(), false); |
| 62 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResi
zerElement(), false); |
| 63 this._rootSplitView.hideMain(); |
| 64 return; |
| 65 } |
| 66 |
| 67 this._rootSplitView.setVertical(state === "left"); |
| 68 this._rootSplitView.setSecondIsSidebar(true); |
| 69 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement(),
true); |
| 70 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResizerE
lement(), state === "top"); |
| 71 this._rootSplitView.showBoth(); |
| 72 }, |
| 73 |
| 74 __proto__: WebInspector.App.prototype |
| 75 }; |
OLD | NEW |