| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 /** | 1045 /** |
| 1046 * @constructor | 1046 * @constructor |
| 1047 * @implements {WebInspector.TargetManager.Observer} | 1047 * @implements {WebInspector.TargetManager.Observer} |
| 1048 */ | 1048 */ |
| 1049 WebInspector.BackendSettingsSync = function() | 1049 WebInspector.BackendSettingsSync = function() |
| 1050 { | 1050 { |
| 1051 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC
reatedPages"); | 1051 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC
reatedPages"); |
| 1052 this._autoAttachSetting.addChangeListener(this._update, this); | 1052 this._autoAttachSetting.addChangeListener(this._update, this); |
| 1053 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc
riptDisabled"); | 1053 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc
riptDisabled"); |
| 1054 this._disableJavascriptSetting.addChangeListener(this._update, this); | 1054 this._disableJavascriptSetting.addChangeListener(this._update, this); |
| 1055 this._blockedEventsWarningSetting = WebInspector.settings.moduleSetting("blo
ckedEventsWarningEnabled"); |
| 1056 this._blockedEventsWarningSetting.addChangeListener(this._update, this); |
| 1055 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag
e); | 1057 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag
e); |
| 1056 } | 1058 } |
| 1057 | 1059 |
| 1058 WebInspector.BackendSettingsSync.prototype = { | 1060 WebInspector.BackendSettingsSync.prototype = { |
| 1061 /** |
| 1062 * @param {!WebInspector.Target} target |
| 1063 */ |
| 1064 _updateTarget: function(target) |
| 1065 { |
| 1066 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g
et()); |
| 1067 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri
ptSetting.get()); |
| 1068 |
| 1069 var blockedEventsWarningThresholdSeconds = 0.1; |
| 1070 target.inputAgent().setBlockedEventsWarningThreshold(this._blockedEvents
WarningSetting.get() ? blockedEventsWarningThresholdSeconds : 0); |
| 1071 }, |
| 1072 |
| 1059 _update: function() | 1073 _update: function() |
| 1060 { | 1074 { |
| 1061 for (var target of WebInspector.targetManager.targets(WebInspector.Targe
t.Type.Page)) { | 1075 WebInspector.targetManager.targets(WebInspector.Target.Type.Page).forEac
h(this._updateTarget, this); |
| 1062 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetti
ng.get()); | |
| 1063 target.emulationAgent().setScriptExecutionDisabled(this._disableJava
scriptSetting.get()); | |
| 1064 } | |
| 1065 }, | 1076 }, |
| 1066 | 1077 |
| 1067 /** | 1078 /** |
| 1068 * @param {!WebInspector.Target} target | 1079 * @param {!WebInspector.Target} target |
| 1069 * @override | 1080 * @override |
| 1070 */ | 1081 */ |
| 1071 targetAdded: function(target) | 1082 targetAdded: function(target) |
| 1072 { | 1083 { |
| 1073 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g
et()); | 1084 this._updateTarget(target); |
| 1074 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri
ptSetting.get()); | |
| 1075 target.renderingAgent().setShowViewportSizeOnResize(true); | 1085 target.renderingAgent().setShowViewportSizeOnResize(true); |
| 1076 }, | 1086 }, |
| 1077 | 1087 |
| 1078 /** | 1088 /** |
| 1079 * @param {!WebInspector.Target} target | 1089 * @param {!WebInspector.Target} target |
| 1080 * @override | 1090 * @override |
| 1081 */ | 1091 */ |
| 1082 targetRemoved: function(target) | 1092 targetRemoved: function(target) |
| 1083 { | 1093 { |
| 1084 } | 1094 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1098 * @return {?Element} | 1108 * @return {?Element} |
| 1099 */ | 1109 */ |
| 1100 settingElement: function() | 1110 settingElement: function() |
| 1101 { | 1111 { |
| 1102 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri
ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); | 1112 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri
ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); |
| 1103 } | 1113 } |
| 1104 } | 1114 } |
| 1105 | 1115 |
| 1106 | 1116 |
| 1107 new WebInspector.Main(); | 1117 new WebInspector.Main(); |
| OLD | NEW |