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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman's comment Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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 * @implements {WebInspector.App} 7 * @implements {WebInspector.App}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.ScreencastApp = function() 10 WebInspector.ScreencastApp = function()
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 _onScreencastEnabledChanged: function() 85 _onScreencastEnabledChanged: function()
86 { 86 {
87 if (!this._rootSplitWidget) 87 if (!this._rootSplitWidget)
88 return; 88 return;
89 var enabled = this._enabledSetting.get() && this._screencastView; 89 var enabled = this._enabledSetting.get() && this._screencastView;
90 this._toggleButton.setToggled(enabled); 90 this._toggleButton.setToggled(enabled);
91 if (enabled) 91 if (enabled)
92 this._rootSplitWidget.showBoth(); 92 this._rootSplitWidget.showBoth();
93 else 93 else
94 this._rootSplitWidget.hideMain(); 94 this._rootSplitWidget.hideMain();
95 },
96
97 _requestAppBanner: function()
98 {
99 if (this._target && this._target.pageAgent())
100 this._target.pageAgent().requestAppBanner();
95 } 101 }
96 }; 102 };
97 103
98 104
99 /** @type {!WebInspector.ScreencastApp} */ 105 /** @type {!WebInspector.ScreencastApp} */
100 WebInspector.ScreencastApp._appInstance; 106 WebInspector.ScreencastApp._appInstance;
101 107
102 /** 108 /**
103 * @return {!WebInspector.ScreencastApp} 109 * @return {!WebInspector.ScreencastApp}
104 */ 110 */
(...skipping 16 matching lines...) Expand all
121 /** 127 /**
122 * @override 128 * @override
123 * @return {?WebInspector.ToolbarItem} 129 * @return {?WebInspector.ToolbarItem}
124 */ 130 */
125 item: function() 131 item: function()
126 { 132 {
127 return WebInspector.ScreencastApp._instance()._toggleButton; 133 return WebInspector.ScreencastApp._instance()._toggleButton;
128 } 134 }
129 } 135 }
130 136
137
138 /**
139 * @constructor
140 * @implements {WebInspector.ActionDelegate}
141 */
142 WebInspector.ScreencastApp.ActionDelegate = function()
143 {
144 };
145
146 WebInspector.ScreencastApp.ActionDelegate.prototype = {
147 /**
148 * @override
149 * @param {!WebInspector.Context} context
150 * @param {string} actionId
151 * @return {boolean}
152 */
153 handleAction: function(context, actionId)
154 {
155 if (actionId === "screencast.request-app-banner") {
156 WebInspector.ScreencastApp._instance()._requestAppBanner()
157 return true;
158 }
159 return false;
160 }
161 };
162
163
131 /** 164 /**
132 * @constructor 165 * @constructor
133 * @implements {WebInspector.AppProvider} 166 * @implements {WebInspector.AppProvider}
134 */ 167 */
135 WebInspector.ScreencastAppProvider = function() 168 WebInspector.ScreencastAppProvider = function()
136 { 169 {
137 }; 170 };
138 171
139 WebInspector.ScreencastAppProvider.prototype = { 172 WebInspector.ScreencastAppProvider.prototype = {
140 /** 173 /**
141 * @override 174 * @override
142 * @return {!WebInspector.App} 175 * @return {!WebInspector.App}
143 */ 176 */
144 createApp: function() 177 createApp: function()
145 { 178 {
146 return WebInspector.ScreencastApp._instance(); 179 return WebInspector.ScreencastApp._instance();
147 } 180 }
148 }; 181 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698