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 { |
11 WebInspector.VBox.call(this, true); | 11 WebInspector.VBox.call(this, true); |
12 this.registerRequiredCSS("network/networkConfigView.css"); | 12 this.registerRequiredCSS("network/networkConfigView.css"); |
13 this.contentElement.classList.add("network-config"); | 13 this.contentElement.classList.add("network-config"); |
14 | 14 |
15 this._createCacheSection(); | 15 this._createCacheSection(); |
16 this.contentElement.createChild("div").classList.add("panel-section-separato
r"); | 16 this.contentElement.createChild("div").classList.add("panel-section-separato
r"); |
17 this._createNetworkThrottlingSection(); | 17 this._createNetworkThrottlingSection(); |
18 this.contentElement.createChild("div").classList.add("panel-section-separato
r"); | 18 this.contentElement.createChild("div").classList.add("panel-section-separato
r"); |
19 this._createUserAgentSection(); | 19 this._createUserAgentSection(); |
20 } | 20 }; |
21 | 21 |
22 WebInspector.NetworkConfigView.prototype = { | 22 WebInspector.NetworkConfigView.prototype = { |
23 /** | 23 /** |
24 * @param {string} title | 24 * @param {string} title |
25 * @param {string=} className | 25 * @param {string=} className |
26 * @return {!Element} | 26 * @return {!Element} |
27 */ | 27 */ |
28 _createSection: function(title, className) | 28 _createSection: function(title, className) |
29 { | 29 { |
30 var section = this.contentElement.createChild("section", "network-config
-group"); | 30 var section = this.contentElement.createChild("section", "network-config
-group"); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 { | 76 { |
77 var useCustomUA = !this._autoCheckbox.checked; | 77 var useCustomUA = !this._autoCheckbox.checked; |
78 this._customUserAgent.classList.toggle("checked", useCustomUA); | 78 this._customUserAgent.classList.toggle("checked", useCustomUA); |
79 this._customSelectAndInput.select.disabled = !useCustomUA; | 79 this._customSelectAndInput.select.disabled = !useCustomUA; |
80 this._customSelectAndInput.input.disabled = !useCustomUA; | 80 this._customSelectAndInput.input.disabled = !useCustomUA; |
81 var customUA = useCustomUA ? this._customUserAgentSetting.get() : ""; | 81 var customUA = useCustomUA ? this._customUserAgentSetting.get() : ""; |
82 WebInspector.multitargetNetworkManager.setCustomUserAgentOverride(custom
UA); | 82 WebInspector.multitargetNetworkManager.setCustomUserAgentOverride(custom
UA); |
83 }, | 83 }, |
84 | 84 |
85 __proto__ : WebInspector.VBox.prototype | 85 __proto__ : WebInspector.VBox.prototype |
86 } | 86 }; |
87 | 87 |
88 | 88 |
89 /** | 89 /** |
90 * @return {{select: !Element, input: !Element}} | 90 * @return {{select: !Element, input: !Element}} |
91 */ | 91 */ |
92 WebInspector.NetworkConfigView.createUserAgentSelectAndInput = function() | 92 WebInspector.NetworkConfigView.createUserAgentSelectAndInput = function() |
93 { | 93 { |
94 var userAgentSetting = WebInspector.settings.createSetting("customUserAgent"
, ""); | 94 var userAgentSetting = WebInspector.settings.createSetting("customUserAgent"
, ""); |
95 var userAgentSelectElement = createElement("select"); | 95 var userAgentSelectElement = createElement("select"); |
96 | 96 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 function applyOtherUserAgent() | 152 function applyOtherUserAgent() |
153 { | 153 { |
154 if (userAgentSetting.get() !== otherUserAgentElement.value) { | 154 if (userAgentSetting.get() !== otherUserAgentElement.value) { |
155 userAgentSetting.set(otherUserAgentElement.value); | 155 userAgentSetting.set(otherUserAgentElement.value); |
156 otherUserAgentElement.title = otherUserAgentElement.value; | 156 otherUserAgentElement.title = otherUserAgentElement.value; |
157 settingChanged(); | 157 settingChanged(); |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 return { select: userAgentSelectElement, input: otherUserAgentElement }; | 161 return { select: userAgentSelectElement, input: otherUserAgentElement }; |
162 } | 162 }; |
163 | 163 |
164 /** @type {!Array.<{title: string, values: !Array.<{title: string, value: string
}>}>} */ | 164 /** @type {!Array.<{title: string, values: !Array.<{title: string, value: string
}>}>} */ |
165 WebInspector.NetworkConfigView._userAgentGroups = [ | 165 WebInspector.NetworkConfigView._userAgentGroups = [ |
166 { | 166 { |
167 title: "Android", | 167 title: "Android", |
168 values: [ | 168 values: [ |
169 {title: "Android (4.0.2) Browser \u2014 Galaxy Nexus", value: "Mozil
la/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/5
34.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"}, | 169 {title: "Android (4.0.2) Browser \u2014 Galaxy Nexus", value: "Mozil
la/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/5
34.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"}, |
170 {title: "Android (2.3) Browser \u2014 Nexus S", value: "Mozilla/5.0
(Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML,
like Gecko) Version/4.0 Mobile Safari/533.1"} | 170 {title: "Android (2.3) Browser \u2014 Nexus S", value: "Mozilla/5.0
(Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML,
like Gecko) Version/4.0 Mobile Safari/533.1"} |
171 ] | 171 ] |
172 }, | 172 }, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 ] | 245 ] |
246 }, | 246 }, |
247 { | 247 { |
248 title: "UC Browser", | 248 title: "UC Browser", |
249 values: [ | 249 values: [ |
250 {title: "UC Browser \u2014 Android Mobile", value: "Mozilla/5.0 (Lin
ux; U; Android 4.4.4; en-US; XT1022 Build/KXC21.5-40) AppleWebKit/534.30 (KHTML,
like Gecko) Version/4.0 UCBrowser/10.7.0.636 U3/0.8.0 Mobile Safari/534.30"}, | 250 {title: "UC Browser \u2014 Android Mobile", value: "Mozilla/5.0 (Lin
ux; U; Android 4.4.4; en-US; XT1022 Build/KXC21.5-40) AppleWebKit/534.30 (KHTML,
like Gecko) Version/4.0 UCBrowser/10.7.0.636 U3/0.8.0 Mobile Safari/534.30"}, |
251 {title: "UC Browser \u2014 iOS", value: "UCWEB/2.0 (iPad; U; CPU OS
7_1 like Mac OS X; en; iPad3,6) U2/1.0.0 UCBrowser/9.3.1.344"}, | 251 {title: "UC Browser \u2014 iOS", value: "UCWEB/2.0 (iPad; U; CPU OS
7_1 like Mac OS X; en; iPad3,6) U2/1.0.0 UCBrowser/9.3.1.344"}, |
252 {title: "UC Browser \u2014 Windows Phone", value: "NokiaX2-02/2.0 (1
1.79) Profile/MIDP-2.1 Configuration/CLDC-1.1 Mozilla/4.0 (compatible; MSIE 8.0;
Windows NT 6.1; Trident/4.0; SLCC2;.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET
CLR 3.0.30729; Media Center PC 6.0; InfoPath.2) UCBrowser8.4.0.159/70/352"} | 252 {title: "UC Browser \u2014 Windows Phone", value: "NokiaX2-02/2.0 (1
1.79) Profile/MIDP-2.1 Configuration/CLDC-1.1 Mozilla/4.0 (compatible; MSIE 8.0;
Windows NT 6.1; Trident/4.0; SLCC2;.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET
CLR 3.0.30729; Media Center PC 6.0; InfoPath.2) UCBrowser8.4.0.159/70/352"} |
253 ] | 253 ] |
254 } | 254 } |
255 ] | 255 ]; |
OLD | NEW |