| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * @constructor | 151 * @constructor |
| 152 * @extends {WebInspector.OverridesView.Tab} | 152 * @extends {WebInspector.OverridesView.Tab} |
| 153 */ | 153 */ |
| 154 WebInspector.OverridesView.DeviceTab = function() | 154 WebInspector.OverridesView.DeviceTab = function() |
| 155 { | 155 { |
| 156 WebInspector.OverridesView.Tab.call(this, "device", WebInspector.UIString("D
evice"), []); | 156 WebInspector.OverridesView.Tab.call(this, "device", WebInspector.UIString("D
evice"), []); |
| 157 this.element.classList.add("overrides-device"); | 157 this.element.classList.add("overrides-device"); |
| 158 | 158 |
| 159 this._emulatedDeviceSetting = WebInspector.settings.createSetting("emulatedD
evice", "Google Nexus 4"); | 159 this._deviceSelectElement = WebInspector.overridesSupport.createDeviceSelect
(document); |
| 160 | 160 this._deviceSelectElement.addEventListener("change", this._updateValueLabels
.bind(this), false); |
| 161 this._deviceSelectElement = this.element.createChild("select"); | |
| 162 | |
| 163 var devices = WebInspector.OverridesView.DeviceTab._phones.concat(WebInspect
or.OverridesView.DeviceTab._tablets); | |
| 164 devices.sort(); | |
| 165 var selectionRestored = false; | |
| 166 for (var i = 0; i < devices.length; ++i) { | |
| 167 var device = devices[i]; | |
| 168 var option = new Option(device[0], device[0]); | |
| 169 option._userAgent = device[1]; | |
| 170 option._metrics = device[2]; | |
| 171 this._deviceSelectElement.add(option); | |
| 172 if (this._emulatedDeviceSetting.get() === device[0]) { | |
| 173 this._deviceSelectElement.selectedIndex = i; | |
| 174 selectionRestored = true; | |
| 175 } | |
| 176 } | |
| 177 | |
| 178 if (!selectionRestored) | |
| 179 this._deviceSelectElement.selectedIndex = devices.length - 1; | |
| 180 | |
| 181 this._deviceSelectElement.addEventListener("change", this._deviceSelected.bi
nd(this), false); | |
| 182 this._deviceSelectElement.addEventListener("keypress", this._keyPressed.bind
(this), false); | 161 this._deviceSelectElement.addEventListener("keypress", this._keyPressed.bind
(this), false); |
| 183 this._deviceSelectElement.disabled = WebInspector.overridesSupport.isInspect
ingDevice(); | 162 this.element.appendChild(this._deviceSelectElement); |
| 184 | 163 |
| 185 var buttonsBar = this.element.createChild("div"); | 164 var buttonsBar = this.element.createChild("div"); |
| 186 var emulateButton = buttonsBar.createChild("button", "settings-tab-text-butt
on"); | 165 var emulateButton = buttonsBar.createChild("button", "settings-tab-text-butt
on"); |
| 187 emulateButton.textContent = WebInspector.UIString("Emulate"); | 166 emulateButton.textContent = WebInspector.UIString("Emulate"); |
| 188 emulateButton.addEventListener("click", this._emulateButtonClicked.bind(this
), false); | 167 emulateButton.addEventListener("click", this._emulateButtonClicked.bind(this
), false); |
| 189 emulateButton.disabled = WebInspector.overridesSupport.isInspectingDevice(); | 168 emulateButton.disabled = WebInspector.overridesSupport.isInspectingDevice(); |
| 190 | 169 |
| 191 var resetButton = buttonsBar.createChild("button", "settings-tab-text-button
"); | 170 var resetButton = buttonsBar.createChild("button", "settings-tab-text-button
"); |
| 192 resetButton.textContent = WebInspector.UIString("Reset"); | 171 resetButton.textContent = WebInspector.UIString("Reset"); |
| 193 resetButton.addEventListener("click", this._resetButtonClicked.bind(this), f
alse); | 172 resetButton.addEventListener("click", this._resetButtonClicked.bind(this), f
alse); |
| 194 this._resetButton = resetButton; | 173 this._resetButton = resetButton; |
| 195 | 174 |
| 196 this._viewportValueLabel = this.element.createChild("div", "overrides-device
-value-label"); | 175 this._viewportValueLabel = this.element.createChild("div", "overrides-device
-value-label"); |
| 197 this._viewportValueLabel.textContent = WebInspector.UIString("Viewport:"); | 176 this._viewportValueLabel.textContent = WebInspector.UIString("Viewport:"); |
| 198 this._viewportValueElement = this._viewportValueLabel.createChild("span", "o
verrides-device-value"); | 177 this._viewportValueElement = this._viewportValueLabel.createChild("span", "o
verrides-device-value"); |
| 199 | 178 |
| 200 this._userAgentLabel = this.element.createChild("div", "overrides-device-val
ue-label"); | 179 this._userAgentLabel = this.element.createChild("div", "overrides-device-val
ue-label"); |
| 201 this._userAgentLabel.textContent = WebInspector.UIString("User agent:"); | 180 this._userAgentLabel.textContent = WebInspector.UIString("User agent:"); |
| 202 this._userAgentValueElement = this._userAgentLabel.createChild("span", "over
rides-device-value"); | 181 this._userAgentValueElement = this._userAgentLabel.createChild("span", "over
rides-device-value"); |
| 203 | 182 |
| 204 this._updateValueLabels(); | 183 this._updateValueLabels(); |
| 205 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.HasActiveOverridesChanged, this._hasActiveOverridesChanged, this); | 184 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.HasActiveOverridesChanged, this._hasActiveOverridesChanged, this); |
| 206 this._hasActiveOverridesChanged(); | 185 this._hasActiveOverridesChanged(); |
| 207 } | 186 } |
| 208 | 187 |
| 209 // Third element lists device metrics separated by 'x': | |
| 210 // - screen width, | |
| 211 // - screen height, | |
| 212 // - device scale factor, | |
| 213 WebInspector.OverridesView.DeviceTab._phones = [ | |
| 214 ["Apple iPhone 3GS", | |
| 215 "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWeb
Kit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", | |
| 216 "320x480x1"], | |
| 217 ["Apple iPhone 4", | |
| 218 "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWeb
Kit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", | |
| 219 "320x480x2"], | |
| 220 ["Apple iPhone 5", | |
| 221 "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/5
37.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", | |
| 222 "320x568x2"], | |
| 223 ["BlackBerry Z10", | |
| 224 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/
10.0.9.2372 Mobile Safari/537.10+", | |
| 225 "384x640x2"], | |
| 226 ["BlackBerry Z30", | |
| 227 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/
10.0.9.2372 Mobile Safari/537.10+", | |
| 228 "360x640x2"], | |
| 229 ["Google Nexus 4", | |
| 230 "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) AppleWebKi
t/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", | |
| 231 "384x640x2"], | |
| 232 ["Google Nexus 5", | |
| 233 "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKi
t/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", | |
| 234 "360x640x3"], | |
| 235 ["Google Nexus S", | |
| 236 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus S Build/GRJ22) AppleWeb
Kit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 237 "320x533x1.5"], | |
| 238 ["HTC Evo, Touch HD, Desire HD, Desire", | |
| 239 "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Sprint APA9292KT Build/FRF91) A
ppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 240 "320x533x1.5"], | |
| 241 ["HTC One X, EVO LTE", | |
| 242 "Mozilla/5.0 (Linux; Android 4.0.3; HTC One X Build/IML74K) AppleWebKit/535
.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", | |
| 243 "360x640x2"], | |
| 244 ["HTC Sensation, Evo 3D", | |
| 245 "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; HTC Sensation Build/IML74K) A
ppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 246 "360x640x1.5"], | |
| 247 ["LG Optimus 2X, Optimus 3D, Optimus Black", | |
| 248 "Mozilla/5.0 (Linux; U; Android 2.2; en-us; LG-P990/V08c Build/FRG83) Apple
WebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MMS/LG-Android-
MMS-V1.0/1.2", | |
| 249 "320x533x1.5"], | |
| 250 ["LG Optimus G", | |
| 251 "Mozilla/5.0 (Linux; Android 4.0; LG-E975 Build/IMM76L) AppleWebKit/535.19
(KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", | |
| 252 "384x640x2"], | |
| 253 ["LG Optimus LTE, Optimus 4X HD", | |
| 254 "Mozilla/5.0 (Linux; U; Android 2.3; en-us; LG-P930 Build/GRJ90) AppleWebKi
t/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 255 "424x753x1.7"], | |
| 256 ["LG Optimus One", | |
| 257 "Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; LG-MS690 Build/FRG83) AppleWe
bKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 258 "213x320x1.5"], | |
| 259 ["Motorola Defy, Droid, Droid X, Milestone", | |
| 260 "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Milestone Build/ SHOLS_U2_01.03
.1) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17", | |
| 261 "320x569x1.5"], | |
| 262 ["Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2", | |
| 263 "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Droid Build/FRG22D) AppleWebKit
/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 264 "540x960x1"], | |
| 265 ["Motorola Droid Razr HD", | |
| 266 "Mozilla/5.0 (Linux; U; Android 2.3; en-us; DROID RAZR 4G Build/6.5.1-73_DH
D-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.
1", | |
| 267 "720x1280x1"], | |
| 268 ["Nokia C5, C6, C7, N97, N8, X7", | |
| 269 "NokiaN97/21.1.107 (SymbianOS/9.4; Series60/5.0 Mozilla/5.0; Profile/MIDP-2
.1 Configuration/CLDC-1.1) AppleWebkit/525 (KHTML, like Gecko) BrowserNG/7.1.4", | |
| 270 "360x640x1"], | |
| 271 ["Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900", | |
| 272 "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobi
le/10.0; ARM; Touch; NOKIA; Lumia 820)", | |
| 273 "320x533x1.5"], | |
| 274 ["Samsung Galaxy Note 3", | |
| 275 "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWeb
Kit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 276 "540x960x2"], | |
| 277 ["Samsung Galaxy Note II", | |
| 278 "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWeb
Kit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 279 "360x640x2"], | |
| 280 ["Samsung Galaxy Note", | |
| 281 "Mozilla/5.0 (Linux; U; Android 2.3; en-us; SAMSUNG-SGH-I717 Build/GINGERBR
EAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 282 "400x640x2"], | |
| 283 ["Samsung Galaxy S III, Galaxy Nexus", | |
| 284 "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWeb
Kit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 285 "360x640x2"], | |
| 286 ["Samsung Galaxy S, S II, W", | |
| 287 "Mozilla/5.0 (Linux; U; Android 2.1; en-us; GT-I9000 Build/ECLAIR) AppleWeb
Kit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2", | |
| 288 "320x533x1.5"], | |
| 289 ["Samsung Galaxy S4", | |
| 290 "Mozilla/5.0 (Linux; Android 4.2.2; GT-I9505 Build/JDQ39) AppleWebKit/537.3
6 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36", | |
| 291 "360x640x3"], | |
| 292 ["Sony Xperia S, Ion", | |
| 293 "Mozilla/5.0 (Linux; U; Android 4.0; en-us; LT28at Build/6.1.C.1.111) Apple
WebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 294 "360x640x2"], | |
| 295 ["Sony Xperia Sola, U", | |
| 296 "Mozilla/5.0 (Linux; U; Android 2.3; en-us; SonyEricssonST25i Build/6.0.B.1
.564) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 297 "480x854x1"], | |
| 298 ["Sony Xperia Z, Z1", | |
| 299 "Mozilla/5.0 (Linux; U; Android 4.2; en-us; SonyC6903 Build/14.1.G.1.518) A
ppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", | |
| 300 "360x640x3"], | |
| 301 ]; | |
| 302 | |
| 303 WebInspector.OverridesView.DeviceTab._tablets = [ | |
| 304 ["Amazon Kindle Fire HDX 7\u2033", | |
| 305 "Mozilla/5.0 (Linux; U; en-us; KFTHWI Build/JDQ39) AppleWebKit/535.19 (KHTM
L, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true", | |
| 306 "1920x1200x2"], | |
| 307 ["Amazon Kindle Fire HDX 8.9\u2033", | |
| 308 "Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTM
L, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true", | |
| 309 "2560x1600x2"], | |
| 310 ["Amazon Kindle Fire (First Generation)", | |
| 311 "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.141.16-G
en4_11004310) AppleWebkit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 S
ilk-Accelerated=true", | |
| 312 "1024x600x1"], | |
| 313 ["Apple iPad 1 / 2 / iPad Mini", | |
| 314 "Mozilla/5.0 (iPad; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9
(KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5", | |
| 315 "1024x768x1"], | |
| 316 ["Apple iPad 3 / 4", | |
| 317 "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML,
like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", | |
| 318 "1024x768x2"], | |
| 319 ["BlackBerry PlayBook", | |
| 320 "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (
KHTML like Gecko) Version/7.2.1.0 Safari/536.2+", | |
| 321 "1024x600x1"], | |
| 322 ["Google Nexus 10", | |
| 323 "Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36", | |
| 324 "1280x800x2"], | |
| 325 ["Google Nexus 7 2", | |
| 326 "Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36", | |
| 327 "960x600x2"], | |
| 328 ["Google Nexus 7", | |
| 329 "Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36", | |
| 330 "966x604x1.325"], | |
| 331 ["Motorola Xoom, Xyboard", | |
| 332 "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/5
25.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2", | |
| 333 "1280x800x1"], | |
| 334 ["Samsung Galaxy Tab 7.7, 8.9, 10.1", | |
| 335 "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebK
it/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 336 "1280x800x1"], | |
| 337 ["Samsung Galaxy Tab", | |
| 338 "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebK
it/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | |
| 339 "1024x600x1"], | |
| 340 ]; | |
| 341 | |
| 342 WebInspector.OverridesView.DeviceTab.prototype = { | 188 WebInspector.OverridesView.DeviceTab.prototype = { |
| 343 /** | 189 /** |
| 344 * @param {!Event} e | 190 * @param {!Event} e |
| 345 */ | 191 */ |
| 346 _keyPressed: function(e) | 192 _keyPressed: function(e) |
| 347 { | 193 { |
| 348 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) | 194 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) |
| 349 this._emulateButtonClicked(); | 195 this._emulateButtonClicked(); |
| 350 }, | 196 }, |
| 351 | 197 |
| 352 _emulateButtonClicked: function() | 198 _emulateButtonClicked: function() |
| 353 { | 199 { |
| 354 var option = this._deviceSelectElement.options[this._deviceSelectElement
.selectedIndex]; | 200 var option = this._deviceSelectElement.options[this._deviceSelectElement
.selectedIndex]; |
| 355 WebInspector.overridesSupport.emulateDevice(option._metrics, option._use
rAgent); | 201 WebInspector.overridesSupport.emulateDevice(option.metrics, option.userA
gent); |
| 356 }, | 202 }, |
| 357 | 203 |
| 358 _resetButtonClicked: function() | 204 _resetButtonClicked: function() |
| 359 { | 205 { |
| 360 WebInspector.overridesSupport.reset(); | 206 WebInspector.overridesSupport.reset(); |
| 361 }, | 207 }, |
| 362 | 208 |
| 363 _hasActiveOverridesChanged: function() | 209 _hasActiveOverridesChanged: function() |
| 364 { | 210 { |
| 365 this._resetButton.disabled = !WebInspector.overridesSupport.hasActiveOve
rrides(); | 211 this._resetButton.disabled = !WebInspector.overridesSupport.hasActiveOve
rrides(); |
| 366 }, | 212 }, |
| 367 | 213 |
| 368 _deviceSelected: function() | |
| 369 { | |
| 370 var option = this._deviceSelectElement.options[this._deviceSelectElement
.selectedIndex]; | |
| 371 this._emulatedDeviceSetting.set(option.value); | |
| 372 this._updateValueLabels(); | |
| 373 }, | |
| 374 | |
| 375 _updateValueLabels: function() | 214 _updateValueLabels: function() |
| 376 { | 215 { |
| 377 var option = this._deviceSelectElement.options[this._deviceSelectElement
.selectedIndex]; | 216 var option = this._deviceSelectElement.options[this._deviceSelectElement
.selectedIndex]; |
| 378 var metrics; | 217 var metrics; |
| 379 if (option._metrics && (metrics = WebInspector.OverridesSupport.DeviceMe
trics.parseSetting(option._metrics))) | 218 if (option.metrics && (metrics = WebInspector.OverridesSupport.DeviceMet
rics.parseSetting(option.metrics))) |
| 380 this._viewportValueElement.textContent = WebInspector.UIString("%s \
xD7 %s, devicePixelRatio = %s", metrics.width, metrics.height, metrics.deviceSca
leFactor); | 219 this._viewportValueElement.textContent = WebInspector.UIString("%s \
xD7 %s, devicePixelRatio = %s", metrics.width, metrics.height, metrics.deviceSca
leFactor); |
| 381 else | 220 else |
| 382 this._viewportValueElement.textContent = ""; | 221 this._viewportValueElement.textContent = ""; |
| 383 this._userAgentValueElement.textContent = option._userAgent || ""; | 222 this._userAgentValueElement.textContent = option.userAgent || ""; |
| 384 }, | 223 }, |
| 385 | 224 |
| 386 __proto__: WebInspector.OverridesView.Tab.prototype | 225 __proto__: WebInspector.OverridesView.Tab.prototype |
| 387 } | 226 } |
| 388 | 227 |
| 389 | 228 |
| 390 /** | 229 /** |
| 391 * @constructor | 230 * @constructor |
| 392 * @extends {WebInspector.OverridesView.Tab} | 231 * @extends {WebInspector.OverridesView.Tab} |
| 393 */ | 232 */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 404 var footnote = this.element.createChild("p", "help-footnote"); | 243 var footnote = this.element.createChild("p", "help-footnote"); |
| 405 var footnoteLink = footnote.createChild("a"); | 244 var footnoteLink = footnote.createChild("a"); |
| 406 footnoteLink.href = "https://developers.google.com/chrome-developer-tools/do
cs/mobile-emulation"; | 245 footnoteLink.href = "https://developers.google.com/chrome-developer-tools/do
cs/mobile-emulation"; |
| 407 footnoteLink.target = "_blank"; | 246 footnoteLink.target = "_blank"; |
| 408 footnoteLink.createTextChild(WebInspector.UIString("More information about s
creen emulation")); | 247 footnoteLink.createTextChild(WebInspector.UIString("More information about s
creen emulation")); |
| 409 } | 248 } |
| 410 | 249 |
| 411 WebInspector.OverridesView.ViewportTab.prototype = { | 250 WebInspector.OverridesView.ViewportTab.prototype = { |
| 412 _createDeviceMetricsElement: function() | 251 _createDeviceMetricsElement: function() |
| 413 { | 252 { |
| 414 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat
e resolution"), WebInspector.overridesSupport.settings.overrideDeviceResolution)
; | 253 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat
e screen"), WebInspector.overridesSupport.settings.overrideDeviceResolution); |
| 415 checkbox.firstChild.disabled = WebInspector.overridesSupport.isInspectin
gDevice(); | 254 checkbox.firstChild.disabled = WebInspector.overridesSupport.isInspectin
gDevice(); |
| 416 this.element.appendChild(checkbox); | 255 this.element.appendChild(checkbox); |
| 417 | 256 |
| 418 var fieldsetElement = WebInspector.SettingsUI.createSettingFieldset(WebI
nspector.overridesSupport.settings.overrideDeviceResolution); | 257 var fieldsetElement = WebInspector.SettingsUI.createSettingFieldset(WebI
nspector.overridesSupport.settings.overrideDeviceResolution); |
| 419 if (WebInspector.overridesSupport.isInspectingDevice()) | 258 if (WebInspector.overridesSupport.isInspectingDevice()) |
| 420 fieldsetElement.disabled = true; | 259 fieldsetElement.disabled = true; |
| 421 fieldsetElement.id = "metrics-override-section"; | 260 fieldsetElement.id = "metrics-override-section"; |
| 422 | 261 |
| 423 var tableElement = fieldsetElement.createChild("table", "nowrap"); | 262 var tableElement = fieldsetElement.createChild("table", "nowrap"); |
| 424 | 263 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 fieldsetElement.createChild("br"); | 406 fieldsetElement.createChild("br"); |
| 568 this._otherUserAgentElement = fieldsetElement.createChild("input"); | 407 this._otherUserAgentElement = fieldsetElement.createChild("input"); |
| 569 this._otherUserAgentElement.type = "text"; | 408 this._otherUserAgentElement.type = "text"; |
| 570 this._otherUserAgentElement.value = userAgent; | 409 this._otherUserAgentElement.value = userAgent; |
| 571 this._otherUserAgentElement.title = userAgent; | 410 this._otherUserAgentElement.title = userAgent; |
| 572 | 411 |
| 573 var selectionRestored = false; | 412 var selectionRestored = false; |
| 574 for (var i = 0; i < userAgents.length; ++i) { | 413 for (var i = 0; i < userAgents.length; ++i) { |
| 575 var agent = userAgents[i]; | 414 var agent = userAgents[i]; |
| 576 var option = new Option(agent[0], agent[1]); | 415 var option = new Option(agent[0], agent[1]); |
| 577 option._metrics = agent[2] ? agent[2] : ""; | |
| 578 this._selectElement.add(option); | 416 this._selectElement.add(option); |
| 579 if (userAgent === agent[1]) { | 417 if (userAgent === agent[1]) { |
| 580 this._selectElement.selectedIndex = i; | 418 this._selectElement.selectedIndex = i; |
| 581 selectionRestored = true; | 419 selectionRestored = true; |
| 582 } | 420 } |
| 583 } | 421 } |
| 584 | 422 |
| 585 if (!selectionRestored) { | 423 if (!selectionRestored) { |
| 586 if (!userAgent) | 424 if (!userAgent) |
| 587 this._selectElement.selectedIndex = 0; | 425 this._selectElement.selectedIndex = 0; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 769 |
| 932 __proto__ : WebInspector.OverridesView.Tab.prototype | 770 __proto__ : WebInspector.OverridesView.Tab.prototype |
| 933 } | 771 } |
| 934 | 772 |
| 935 /** @enum {string} */ | 773 /** @enum {string} */ |
| 936 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = { | 774 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = { |
| 937 UserInput: "userInput", | 775 UserInput: "userInput", |
| 938 UserDrag: "userDrag", | 776 UserDrag: "userDrag", |
| 939 ResetButton: "resetButton" | 777 ResetButton: "resetButton" |
| 940 } | 778 } |
| OLD | NEW |