OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebInspector.OverridesUI = {} | 5 WebInspector.OverridesUI = {} |
6 | 6 |
7 /** | 7 /** |
8 * @param {!Document} document | 8 * @param {!Document} document |
9 * @param {!function(!function(string))=} titleProvider | 9 * @param {!function(!function(string))=} titleProvider |
10 * @return {!Element} | 10 * @return {!Element} |
11 */ | 11 */ |
12 WebInspector.OverridesUI.createDeviceSelect = function(document, titleProvider) | 12 WebInspector.OverridesUI.createDeviceSelect = function(document, titleProvider) |
13 { | 13 { |
14 var p = document.createElement("p"); | 14 var p = document.createElement("p"); |
15 | 15 |
16 var deviceSelectElement = p.createChild("select"); | 16 var deviceSelectElement = p.createChild("select"); |
17 deviceSelectElement.addEventListener("change", deviceSelected, false); | 17 deviceSelectElement.addEventListener("change", deviceSelected, false); |
18 | 18 |
19 var saveButton = p.createChild("button", "save-device-button"); | 19 var saveButton = p.createChild("button"); |
20 saveButton.textContent = WebInspector.UIString("Save as"); | 20 saveButton.textContent = WebInspector.UIString("Save as"); |
21 saveButton.addEventListener("click", saveClicked, false); | 21 saveButton.addEventListener("click", saveClicked, false); |
22 | 22 |
23 var removeButton = p.createChild("button", "remove-device-button"); | 23 var removeButton = p.createChild("button"); |
24 removeButton.textContent = WebInspector.UIString("Remove"); | 24 removeButton.textContent = WebInspector.UIString("Remove"); |
25 removeButton.addEventListener("click", removeClicked, false); | 25 removeButton.addEventListener("click", removeClicked, false); |
26 | 26 |
27 // This has to be object, not boolean, otherwise its value doesn't update pr
operly. | 27 // This has to be object, not boolean, otherwise its value doesn't update pr
operly. |
28 var emulatedSettingChangedMuted = { muted: false }; | 28 var emulatedSettingChangedMuted = { muted: false }; |
29 WebInspector.overridesSupport.settings.emulateResolution.addChangeListener(e
mulatedSettingChanged); | 29 WebInspector.overridesSupport.settings.emulateResolution.addChangeListener(e
mulatedSettingChanged); |
30 WebInspector.overridesSupport.settings.deviceWidth.addChangeListener(emulate
dSettingChanged); | 30 WebInspector.overridesSupport.settings.deviceWidth.addChangeListener(emulate
dSettingChanged); |
31 WebInspector.overridesSupport.settings.deviceHeight.addChangeListener(emulat
edSettingChanged); | 31 WebInspector.overridesSupport.settings.deviceHeight.addChangeListener(emulat
edSettingChanged); |
32 WebInspector.overridesSupport.settings.deviceScaleFactor.addChangeListener(e
mulatedSettingChanged); | 32 WebInspector.overridesSupport.settings.deviceScaleFactor.addChangeListener(e
mulatedSettingChanged); |
33 WebInspector.overridesSupport.settings.emulateMobile.addChangeListener(emula
tedSettingChanged); | 33 WebInspector.overridesSupport.settings.emulateMobile.addChangeListener(emula
tedSettingChanged); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 /** @type {!Array.<!WebInspector.OverridesSupport.NetworkConditionsPreset>} */ | 276 /** @type {!Array.<!WebInspector.OverridesSupport.NetworkConditionsPreset>} */ |
277 WebInspector.OverridesUI._networkConditionsPresets = [ | 277 WebInspector.OverridesUI._networkConditionsPresets = [ |
278 {id: "offline", title: "Offline", throughput: 0, latency: 0}, | 278 {id: "offline", title: "Offline", throughput: 0, latency: 0}, |
279 {id: "gprs", title: "GPRS", throughput: 50, latency: 500}, | 279 {id: "gprs", title: "GPRS", throughput: 50, latency: 500}, |
280 {id: "edge", title: "EDGE", throughput: 250, latency: 300}, | 280 {id: "edge", title: "EDGE", throughput: 250, latency: 300}, |
281 {id: "3g", title: "3G", throughput: 750, latency: 100}, | 281 {id: "3g", title: "3G", throughput: 750, latency: 100}, |
282 {id: "dsl", title: "DSL", throughput: 2 * 1024, latency: 5}, | 282 {id: "dsl", title: "DSL", throughput: 2 * 1024, latency: 5}, |
283 {id: "wifi", title: "WiFi", throughput: 30 * 1024, latency: 2}, | 283 {id: "wifi", title: "WiFi", throughput: 30 * 1024, latency: 2}, |
284 {id: "online", title: "No throttling", throughput: WebInspector.OverridesSup
port.NetworkThroughputUnlimitedValue, latency: 0} | 284 {id: "online", title: "No throttling", throughput: WebInspector.OverridesSup
port.NetworkThroughputUnlimitedValue, latency: 0} |
285 ]; | 285 ]; |
OLD | NEW |