Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: Source/devtools/front_end/main/ScreencastApp.js

Issue 283063003: DevTools: Implement extension-based status bar buttons (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Get rid of components/module.json Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/main/SimpleApp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d01ed1395857d19c493f538f23b18b1785c94c0..3377344b6249171d317c79bd78fb9346b0b0ecbc 100644
--- a/Source/devtools/front_end/main/ScreencastApp.js
+++ b/Source/devtools/front_end/main/ScreencastApp.js
@@ -10,25 +10,19 @@ WebInspector.ScreencastApp = function()
{
WebInspector.App.call(this);
- this._currentScreencastState = WebInspector.settings.createSetting("currentScreencastState", "");
- this._lastScreencastState = WebInspector.settings.createSetting("lastScreencastState", "");
+ var currentScreencastState = WebInspector.settings.createSetting("currentScreencastState", "");
+ var lastScreencastState = WebInspector.settings.createSetting("lastScreencastState", "");
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.")],
- this._currentScreencastState,
- this._lastScreencastState,
+ currentScreencastState.get(),
+ currentScreencastState,
+ lastScreencastState,
this._onStatusBarButtonStateChanged.bind(this));
};
WebInspector.ScreencastApp.prototype = {
- createGlobalStatusBarItems: function()
- {
- this.appendInspectStatusBarItem();
- this.appendSettingsStatusBarItem();
- WebInspector.inspectorView.appendToRightToolbar(this._toggleScreencastButton.element);
- },
-
createRootView: function()
{
var rootView = new WebInspector.RootView();
@@ -49,7 +43,6 @@ WebInspector.ScreencastApp.prototype = {
{
WebInspector.App.prototype.presentUI.call(this);
this._screencastView.initialize();
- this._toggleScreencastButton.toggleInitialState();
},
/**
@@ -73,3 +66,23 @@ WebInspector.ScreencastApp.prototype = {
__proto__: WebInspector.App.prototype
};
+
+/**
+ * @constructor
+ * @implements {WebInspector.StatusBarButton.Provider}
+ */
+WebInspector.ScreencastApp.StatusBarButtonProvider = function()
+{
+}
+
+WebInspector.ScreencastApp.StatusBarButtonProvider.prototype = {
+ /**
+ * @return {?WebInspector.StatusBarButton}
+ */
+ button: function()
+ {
+ if (!(WebInspector.app instanceof WebInspector.ScreencastApp))
+ return null;
+ return /** @type {!WebInspector.ScreencastApp} */ (WebInspector.app)._toggleScreencastButton;
+ }
+}
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/main/SimpleApp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698