Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 */ | 8 */ |
| 9 WebInspector.NetworkConfigView = function() | 9 WebInspector.NetworkConfigView = function() |
| 10 { | 10 { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 function userAgentSelected() | 122 function userAgentSelected() |
| 123 { | 123 { |
| 124 var value = userAgentSelectElement.options[userAgentSelectElement.select edIndex].value; | 124 var value = userAgentSelectElement.options[userAgentSelectElement.select edIndex].value; |
| 125 if (value !== customOverride.value) { | 125 if (value !== customOverride.value) { |
| 126 userAgentSetting.set(value); | 126 userAgentSetting.set(value); |
| 127 otherUserAgentElement.value = value; | 127 otherUserAgentElement.value = value; |
| 128 otherUserAgentElement.title = value; | 128 otherUserAgentElement.title = value; |
| 129 otherUserAgentElement.readOnly = true; | 129 otherUserAgentElement.readOnly = true; |
| 130 } else { | 130 } else { |
| 131 otherUserAgentElement.readOnly = false; | 131 otherUserAgentElement.readOnly = false; |
| 132 otherUserAgentElement.value = ""; | |
| 133 otherUserAgentElement.focus(); | 132 otherUserAgentElement.focus(); |
| 134 } | 133 } |
| 135 } | 134 } |
| 136 | 135 |
| 137 function settingChanged() | 136 function settingChanged() |
| 138 { | 137 { |
| 139 var value = userAgentSetting.get(); | 138 var value = userAgentSetting.get(); |
| 140 var options = userAgentSelectElement.options; | 139 var options = userAgentSelectElement.options; |
| 141 var selectionRestored = false; | 140 var selectionRestored = false; |
| 142 for (var i = 0; i < options.length; ++i) { | 141 for (var i = 0; i < options.length; ++i) { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 159 | 158 |
| 160 function textKeyDown(event) | 159 function textKeyDown(event) |
| 161 { | 160 { |
| 162 if (isEnterKey(event)) | 161 if (isEnterKey(event)) |
| 163 textChanged(); | 162 textChanged(); |
| 164 } | 163 } |
| 165 | 164 |
| 166 function textDoubleClicked() | 165 function textDoubleClicked() |
| 167 { | 166 { |
| 168 if (userAgentSelectElement.selectedIndex === 0) | 167 if (userAgentSelectElement.selectedIndex === 0) |
| 169 return; | 168 return |
|
lushnikov
2016/04/26 16:39:17
semicolon is actually needed after the "return"
luoe
2016/04/26 23:11:42
Done.
| |
| 170 userAgentSelectElement.selectedIndex = 0; | 169 userAgentSelectElement.selectedIndex = 0; |
| 171 userAgentSelected(); | 170 userAgentSelected(); |
| 172 } | 171 } |
| 173 | 172 |
| 174 function textChanged() | 173 function textChanged() |
| 175 { | 174 { |
| 176 if (userAgentSetting.get() !== otherUserAgentElement.value) { | 175 if (userAgentSetting.get() !== otherUserAgentElement.value) { |
| 177 userAgentSetting.set(otherUserAgentElement.value); | 176 userAgentSetting.set(otherUserAgentElement.value); |
| 178 settingChanged(); | 177 settingChanged(); |
| 179 } | 178 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 * @param {!WebInspector.Context} context | 287 * @param {!WebInspector.Context} context |
| 289 * @param {string} actionId | 288 * @param {string} actionId |
| 290 * @return {boolean} | 289 * @return {boolean} |
| 291 */ | 290 */ |
| 292 handleAction: function(context, actionId) | 291 handleAction: function(context, actionId) |
| 293 { | 292 { |
| 294 WebInspector.inspectorView.showViewInDrawer("network.config"); | 293 WebInspector.inspectorView.showViewInDrawer("network.config"); |
| 295 return true; | 294 return true; |
| 296 } | 295 } |
| 297 } | 296 } |
| OLD | NEW |