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

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

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

Powered by Google App Engine
This is Rietveld 408576698