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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js

Issue 2757093002: [Devtools] Fix offline checkbox state sharing across Network and Application>Service Workers panels (Closed)
Patch Set: Rebased (I'm now already in the AUTHORS file) Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js b/third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js
index 82f6a3375f260650dd315f1813cc4a7516de559a..25ab9f55d1741c714c8338e7548016a6db81f5fb 100644
--- a/third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js
+++ b/third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js
@@ -176,21 +176,19 @@ NetworkConditions.NetworkConditionsSelector = class {
SDK.MultitargetNetworkManager.Events.ConditionsChanged, networkConditionsChanged);
checkbox.setChecked(SDK.multitargetNetworkManager.networkConditions() === SDK.NetworkManager.OfflineConditions);
- var lastNetworkConditions;
-
function forceOffline() {
if (checkbox.checked()) {
- lastNetworkConditions = SDK.multitargetNetworkManager.networkConditions();
+ NetworkConditions.NetworkConditionsSelector._lastNetworkConditions =
+ SDK.multitargetNetworkManager.networkConditions();
SDK.multitargetNetworkManager.setNetworkConditions(SDK.NetworkManager.OfflineConditions);
} else {
- SDK.multitargetNetworkManager.setNetworkConditions(lastNetworkConditions);
+ SDK.multitargetNetworkManager.setNetworkConditions(
+ NetworkConditions.NetworkConditionsSelector._lastNetworkConditions);
}
}
function networkConditionsChanged() {
var conditions = SDK.multitargetNetworkManager.networkConditions();
- if (conditions !== SDK.NetworkManager.OfflineConditions)
- lastNetworkConditions = conditions;
checkbox.setChecked(conditions === SDK.NetworkManager.OfflineConditions);
}
return checkbox;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698