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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
index 24f99c2c3ba03af1a43cbcb6a88b05720e2fa84f..5411b805c30a70d7d778dd626ba16247bff1ecac 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -635,6 +635,7 @@ WebInspector.DeviceModeView.Toolbar.prototype = {
contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), this._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"), this._openNetworkConfig.bind(this), false);
+ contextMenu.appendItemsAtLocation("deviceModeMenu");
},
_toggleMediaInspector: function()
@@ -1030,9 +1031,15 @@ WebInspector.DeviceModeView.ActionDelegate.prototype = {
*/
handleAction: function(context, actionId)
{
- if (actionId === "emulation.toggle-device-mode" && WebInspector.DeviceModeView._wrapperInstance) {
- WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode();
- return true;
+ if (WebInspector.DeviceModeView._wrapperInstance) {
+ if (actionId === "emulation.toggle-device-mode") {
+ WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode();
+ return true;
+ }
+ if (actionId === "emulation.request-app-banner") {
+ WebInspector.DeviceModeView._wrapperInstance._requestAppBanner();
+ return true;
+ }
}
return false;
}
@@ -1085,5 +1092,10 @@ WebInspector.DeviceModeView.Wrapper.prototype = {
}
},
+ _requestAppBanner: function()
+ {
+ this._deviceModeView._model.requestAppBanner();
+ },
+
__proto__: WebInspector.VBox.prototype
}

Powered by Google App Engine
This is Rietveld 408576698