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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js

Issue 2938503002: DevTools: unify Network & CPU throttling (Closed)
Patch Set: fmt Created 3 years, 6 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/DeviceModeToolbar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
index 2ad4f24efae5953f324ae256fb2c297b3b21c5bd..9683ec162030e58ef7cb41e2e4b90fb9c65352e5 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
@@ -22,8 +22,8 @@ Emulation.DeviceModeToolbar = class {
this._showUserAgentTypeSetting = Common.settings.createSetting('emulation.showUserAgentType', false);
this._showUserAgentTypeSetting.addChangeListener(this._updateUserAgentTypeVisibility, this);
- this._showNetworkConditionsSetting = Common.settings.createSetting('emulation.showNetworkConditions', false);
- this._showNetworkConditionsSetting.addChangeListener(this._updateNetworkConditionsVisibility, this);
+ this._showThrottlingConditionsSetting = Common.settings.createSetting('emulation.showNetworkConditions', false);
+ this._showThrottlingConditionsSetting.addChangeListener(this._updateThrottlingVisibility, this);
/** @type {!Map<!Emulation.EmulatedDevice, !Emulation.EmulatedDevice.Mode>} */
this._lastMode = new Map();
@@ -186,11 +186,11 @@ Emulation.DeviceModeToolbar = class {
* @param {!UI.Toolbar} toolbar
*/
_fillOptionsToolbar(toolbar) {
- this._networkConditionsItem = MobileThrottling.NetworkConditionsSelector.createToolbarMenuButton();
- this._networkConditionsItem.setVisible(this._showNetworkConditionsSetting.get());
- this._networkConditionsItem.setTitle(Common.UIString('Network throttling'));
- this._networkConditionsItem.element.style.maxWidth = '140px';
- toolbar.appendToolbarItem(this._networkConditionsItem);
+ this._throttlingConditionsItem = MobileThrottling.ThrottlingSelector.createToolbarMenuButton();
+ this._throttlingConditionsItem.setVisible(this._showThrottlingConditionsSetting.get());
+ this._throttlingConditionsItem.setTitle(Common.UIString('Mobile throttling'));
+ this._throttlingConditionsItem.element.style.maxWidth = '160px';
+ toolbar.appendToolbarItem(this._throttlingConditionsItem);
var moreOptionsButton = new UI.ToolbarMenuButton(this._appendOptionsMenuItems.bind(this));
moreOptionsButton.setTitle(Common.UIString('More options'));
@@ -301,8 +301,8 @@ Emulation.DeviceModeToolbar = class {
appendToggleItem(
this._showUserAgentTypeSetting, Common.UIString('Remove device type'), Common.UIString('Add device type'));
appendToggleItem(
- this._showNetworkConditionsSetting, Common.UIString('Remove network throttling'),
- Common.UIString('Add network throttling'));
+ this._showThrottlingConditionsSetting, Common.UIString('Remove mobile throttling'),
dgozman 2017/06/13 01:47:08 Drop 'mobile'. It's a mobile mode anyway.
chenwilliam 2017/06/13 21:54:51 Done.
+ Common.UIString('Add mobile throttling'));
contextMenu.appendSeparator();
contextMenu.appendItemsAtLocation('deviceModeMenu');
contextMenu.appendSeparator();
@@ -327,7 +327,7 @@ Emulation.DeviceModeToolbar = class {
this._showUserAgentTypeSetting.set(false);
this._showMediaInspectorSetting.set(false);
this._showRulersSetting.set(false);
- this._showNetworkConditionsSetting.set(false);
+ this._showThrottlingConditionsSetting.set(false);
this._model.reset();
}
@@ -442,8 +442,8 @@ Emulation.DeviceModeToolbar = class {
this._uaItem.setVisible(this._showUserAgentTypeSetting.get());
}
- _updateNetworkConditionsVisibility() {
- this._networkConditionsItem.setVisible(this._showNetworkConditionsSetting.get());
+ _updateThrottlingVisibility() {
+ this._throttlingConditionsItem.setVisible(this._showThrottlingConditionsSetting.get());
}
/**

Powered by Google App Engine
This is Rietveld 408576698