| 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 */ | 8 */ |
| 9 WebInspector.ScreencastApp = function() | 9 WebInspector.ScreencastApp = function() |
| 10 { | 10 { |
| 11 WebInspector.App.call(this); | 11 WebInspector.App.call(this); |
| 12 | 12 |
| 13 this._currentScreencastState = WebInspector.settings.createSetting("currentS
creencastState", ""); | 13 var currentScreencastState = WebInspector.settings.createSetting("currentScr
eencastState", ""); |
| 14 this._lastScreencastState = WebInspector.settings.createSetting("lastScreenc
astState", ""); | 14 var lastScreencastState = WebInspector.settings.createSetting("lastScreencas
tState", ""); |
| 15 this._toggleScreencastButton = new WebInspector.StatusBarStatesSettingButton
( | 15 this._toggleScreencastButton = new WebInspector.StatusBarStatesSettingButton
( |
| 16 "screencast-status-bar-item", | 16 "screencast-status-bar-item", |
| 17 ["disabled", "left", "top"], | 17 ["disabled", "left", "top"], |
| 18 [WebInspector.UIString("Disable screencast."), WebInspector.UIString("Sw
itch to portrait screencast."), WebInspector.UIString("Switch to landscape scree
ncast.")], | 18 [WebInspector.UIString("Disable screencast."), WebInspector.UIString("Sw
itch to portrait screencast."), WebInspector.UIString("Switch to landscape scree
ncast.")], |
| 19 this._currentScreencastState, | 19 currentScreencastState, |
| 20 this._lastScreencastState, | 20 lastScreencastState, |
| 21 this._onStatusBarButtonStateChanged.bind(this)); | 21 this._onStatusBarButtonStateChanged.bind(this)); |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 WebInspector.ScreencastApp.prototype = { | 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() | 25 createRootView: function() |
| 33 { | 26 { |
| 34 var rootView = new WebInspector.RootView(); | 27 var rootView = new WebInspector.RootView(); |
| 35 | 28 |
| 36 this._rootSplitView = new WebInspector.SplitView(false, true, "Inspector
View.screencastSplitViewState", 300, 300); | 29 this._rootSplitView = new WebInspector.SplitView(false, true, "Inspector
View.screencastSplitViewState", 300, 300); |
| 37 this._rootSplitView.show(rootView.element); | 30 this._rootSplitView.show(rootView.element); |
| 38 | 31 |
| 39 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); | 32 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); |
| 40 var target = /** @type {!WebInspector.Target} */ (WebInspector.targetMan
ager.activeTarget()); | 33 var target = /** @type {!WebInspector.Target} */ (WebInspector.targetMan
ager.activeTarget()); |
| 41 this._screencastView = new WebInspector.ScreencastView(target); | 34 this._screencastView = new WebInspector.ScreencastView(target); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 66 | 59 |
| 67 this._rootSplitView.setVertical(state === "left"); | 60 this._rootSplitView.setVertical(state === "left"); |
| 68 this._rootSplitView.setSecondIsSidebar(true); | 61 this._rootSplitView.setSecondIsSidebar(true); |
| 69 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement(),
true); | 62 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement(),
true); |
| 70 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResizerE
lement(), state === "top"); | 63 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResizerE
lement(), state === "top"); |
| 71 this._rootSplitView.showBoth(); | 64 this._rootSplitView.showBoth(); |
| 72 }, | 65 }, |
| 73 | 66 |
| 74 __proto__: WebInspector.App.prototype | 67 __proto__: WebInspector.App.prototype |
| 75 }; | 68 }; |
| 69 |
| 70 /** |
| 71 * @constructor |
| 72 * @implements {WebInspector.StatusBarButton.Provider} |
| 73 */ |
| 74 WebInspector.ScreencastApp.StatusBarButtonProvider = function() |
| 75 { |
| 76 } |
| 77 |
| 78 WebInspector.ScreencastApp.StatusBarButtonProvider.prototype = { |
| 79 /** |
| 80 * @return {?WebInspector.StatusBarButton} |
| 81 */ |
| 82 button: function() |
| 83 { |
| 84 if (!(WebInspector.app instanceof WebInspector.ScreencastApp)) |
| 85 return null; |
| 86 return /** @type {!WebInspector.ScreencastApp} */ (WebInspector.app)._to
ggleScreencastButton; |
| 87 } |
| 88 } |
| OLD | NEW |