Chromium Code Reviews| Index: Source/devtools/front_end/main/ScreencastApp.js |
| diff --git a/Source/devtools/front_end/main/ScreencastApp.js b/Source/devtools/front_end/main/ScreencastApp.js |
| index 3377344b6249171d317c79bd78fb9346b0b0ecbc..59c05d1d9b95a054d3d7da3b87b9dca13ce205ef 100644 |
| --- a/Source/devtools/front_end/main/ScreencastApp.js |
| +++ b/Source/devtools/front_end/main/ScreencastApp.js |
| @@ -10,14 +10,14 @@ WebInspector.ScreencastApp = function() |
| { |
| WebInspector.App.call(this); |
| - var currentScreencastState = WebInspector.settings.createSetting("currentScreencastState", ""); |
| var lastScreencastState = WebInspector.settings.createSetting("lastScreencastState", ""); |
| + this._currentScreencastState = WebInspector.settings.createSetting("currentScreencastState", ""); |
|
dgozman
2014/06/06 13:13:06
We should initialize both these settings with "dis
apavlov
2014/06/06 13:15:32
Done.
|
| this._toggleScreencastButton = new WebInspector.StatusBarStatesSettingButton( |
| "screencast-status-bar-item", |
| ["disabled", "left", "top"], |
| [WebInspector.UIString("Disable screencast."), WebInspector.UIString("Switch to portrait screencast."), WebInspector.UIString("Switch to landscape screencast.")], |
| - currentScreencastState.get(), |
| - currentScreencastState, |
| + this._currentScreencastState.get(), |
| + this._currentScreencastState, |
| lastScreencastState, |
| this._onStatusBarButtonStateChanged.bind(this)); |
| }; |
| @@ -35,7 +35,7 @@ WebInspector.ScreencastApp.prototype = { |
| this._screencastView = new WebInspector.ScreencastView(target); |
| this._screencastView.show(this._rootSplitView.mainElement()); |
| - this._onStatusBarButtonStateChanged("disabled"); |
| + this._onStatusBarButtonStateChanged(this._currentScreencastState.get()); |
| rootView.attachToBody(); |
| }, |
| @@ -50,6 +50,8 @@ WebInspector.ScreencastApp.prototype = { |
| */ |
| _onStatusBarButtonStateChanged: function(state) |
| { |
| + if (!this._rootSplitView) |
| + return; |
| if (state === "disabled") { |
| this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement(), false); |
| this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResizerElement(), false); |