OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 this._userAgentLabel.textContent = WebInspector.UIString("User agent:"); | 254 this._userAgentLabel.textContent = WebInspector.UIString("User agent:"); |
255 this._userAgentValueElement = this._userAgentLabel.createChild("span", "over rides-device-value"); | 255 this._userAgentValueElement = this._userAgentLabel.createChild("span", "over rides-device-value"); |
256 | 256 |
257 this._updateValueLabels(); | 257 this._updateValueLabels(); |
258 } | 258 } |
259 | 259 |
260 // Third element lists device metrics separated by 'x': | 260 // Third element lists device metrics separated by 'x': |
261 // - screen width, | 261 // - screen width, |
262 // - screen height, | 262 // - screen height, |
263 // - device scale factor, | 263 // - device scale factor, |
264 // - use android font metrics, | |
265 // - use text autosizing. | 264 // - use text autosizing. |
johnme
2013/11/26 16:41:27
While you're editing this, the text autosizing val
| |
266 WebInspector.OverridesView.DeviceTab._phones = [ | 265 WebInspector.OverridesView.DeviceTab._phones = [ |
267 ["Apple iPhone 3GS", | 266 ["Apple iPhone 3GS", |
268 "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", | 267 "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", |
269 "320x480x1x0x1"], | 268 "320x480x1x1"], |
270 ["Apple iPhone 4", | 269 ["Apple iPhone 4", |
271 "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", | 270 "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", |
272 "640x960x2x0x1"], | 271 "640x960x2x1"], |
273 ["Apple iPhone 5", | 272 ["Apple iPhone 5", |
274 "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", | 273 "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", |
275 "640x1136x2x0x1"], | 274 "640x1136x2x1"], |
276 ["BlackBerry Z10", | 275 ["BlackBerry Z10", |
277 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", | 276 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", |
278 "768x1280x2x0x1"], | 277 "768x1280x2x1"], |
279 ["BlackBerry Z30", | 278 ["BlackBerry Z30", |
280 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", | 279 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", |
281 "720x1280x2x0x1"], | 280 "720x1280x2x1"], |
282 ["Google Nexus 4", | 281 ["Google Nexus 4", |
283 "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", | 282 "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", |
284 "768x1280x2x1x1"], | 283 "768x1280x2x1"], |
285 ["Google Nexus 5", | 284 ["Google Nexus 5", |
286 "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", | 285 "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", |
287 "1080x1920x3x1x1"], | 286 "1080x1920x3x1"], |
288 ["Google Nexus S", | 287 ["Google Nexus S", |
289 "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", | 288 "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", |
290 "480x800x1.5x1x1"], | 289 "480x800x1.5x1"], |
291 ["HTC Evo, Touch HD, Desire HD, Desire", | 290 ["HTC Evo, Touch HD, Desire HD, Desire", |
292 "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", | 291 "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", |
293 "480x800x1.5x1x1"], | 292 "480x800x1.5x1"], |
294 ["HTC One X, EVO LTE", | 293 ["HTC One X, EVO LTE", |
295 "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", | 294 "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", |
296 "720x1280x2x1x1"], | 295 "720x1280x2x1"], |
297 ["HTC Sensation, Evo 3D", | 296 ["HTC Sensation, Evo 3D", |
298 "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", | 297 "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", |
299 "540x960x1.5x1x1"], | 298 "540x960x1.5x1"], |
300 ["LG Optimus 2X, Optimus 3D, Optimus Black", | 299 ["LG Optimus 2X, Optimus 3D, Optimus Black", |
301 "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", | 300 "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", |
302 "480x800x1.5x1x1"], | 301 "480x800x1.5x1"], |
303 ["LG Optimus G", | 302 ["LG Optimus G", |
304 "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", | 303 "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", |
305 "768x1280x2x1x1"], | 304 "768x1280x2x1"], |
306 ["LG Optimus LTE, Optimus 4X HD", | 305 ["LG Optimus LTE, Optimus 4X HD", |
307 "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", | 306 "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", |
308 "720x1280x1.7x1x1"], | 307 "720x1280x1.7x1"], |
309 ["LG Optimus One", | 308 ["LG Optimus One", |
310 "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", | 309 "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", |
311 "320x480x1.5x1x1"], | 310 "320x480x1.5x1"], |
312 ["Motorola Defy, Droid, Droid X, Milestone", | 311 ["Motorola Defy, Droid, Droid X, Milestone", |
313 "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", | 312 "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", |
314 "480x854x1.5x1x1"], | 313 "480x854x1.5x1"], |
315 ["Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2", | 314 ["Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2", |
316 "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", | 315 "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", |
317 "540x960x1x1x1"], | 316 "540x960x1x1"], |
318 ["Motorola Droid Razr HD", | 317 ["Motorola Droid Razr HD", |
319 "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", | 318 "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", |
320 "720x1280x1x1x1"], | 319 "720x1280x1x1"], |
321 ["Nokia C5, C6, C7, N97, N8, X7", | 320 ["Nokia C5, C6, C7, N97, N8, X7", |
322 "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", | 321 "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", |
323 "360x640x1x0x1"], | 322 "360x640x1x1"], |
324 ["Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900", | 323 ["Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900", |
325 "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobi le/10.0; ARM; Touch; NOKIA; Lumia 820)", | 324 "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobi le/10.0; ARM; Touch; NOKIA; Lumia 820)", |
326 "480x800x1.5x0x1"], | 325 "480x800x1.5x1"], |
327 ["Samsung Galaxy Note 3", | 326 ["Samsung Galaxy Note 3", |
328 "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", | 327 "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", |
329 "1080x1920x2x1x1"], | 328 "1080x1920x2x1"], |
330 ["Samsung Galaxy Note II", | 329 ["Samsung Galaxy Note II", |
331 "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", | 330 "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", |
332 "720x1280x2x1x1"], | 331 "720x1280x2x1"], |
333 ["Samsung Galaxy Note", | 332 ["Samsung Galaxy Note", |
334 "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", | 333 "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", |
335 "800x1280x2x1x1"], | 334 "800x1280x2x1"], |
336 ["Samsung Galaxy S III, Galaxy Nexus", | 335 ["Samsung Galaxy S III, Galaxy Nexus", |
337 "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", | 336 "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", |
338 "720x1280x2x1x1"], | 337 "720x1280x2x1"], |
339 ["Samsung Galaxy S, S II, W", | 338 ["Samsung Galaxy S, S II, W", |
340 "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", | 339 "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", |
341 "480x800x1.5x1x1"], | 340 "480x800x1.5x1"], |
342 ["Samsung Galaxy S4", | 341 ["Samsung Galaxy S4", |
343 "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", | 342 "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", |
344 "1080x1920x3x1x1"], | 343 "1080x1920x3x1"], |
345 ["Sony Xperia S, Ion", | 344 ["Sony Xperia S, Ion", |
346 "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", | 345 "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", |
347 "720x1280x2x1x1"], | 346 "720x1280x2x1"], |
348 ["Sony Xperia Sola, U", | 347 ["Sony Xperia Sola, U", |
349 "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", | 348 "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", |
350 "480x854x1x1x1"], | 349 "480x854x1x1"], |
351 ["Sony Xperia Z, Z1", | 350 ["Sony Xperia Z, Z1", |
352 "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", | 351 "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", |
353 "1080x1920x3x1x1"], | 352 "1080x1920x3x1"], |
354 ]; | 353 ]; |
355 | 354 |
356 WebInspector.OverridesView.DeviceTab._tablets = [ | 355 WebInspector.OverridesView.DeviceTab._tablets = [ |
357 ["Amazon Amazon Kindle Fire HD 7\"", | 356 ["Amazon Amazon Kindle Fire HD 7\"", |
358 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBR EAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | 357 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBR EAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", |
359 "1280x800x1.5x1x1"], | 358 "1280x800x1.5x1"], |
360 ["Amazon Amazon Kindle Fire HD 8.9\"", | 359 ["Amazon Amazon Kindle Fire HD 8.9\"", |
361 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBR EAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | 360 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBR EAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", |
362 "1920x1200x1.5x1x1"], | 361 "1920x1200x1.5x1"], |
363 ["Amazon Amazon Kindle Fire", | 362 ["Amazon Amazon Kindle Fire", |
364 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD ) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", | 363 "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD ) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", |
365 "1024x600x1x1x1"], | 364 "1024x600x1x1"], |
366 ["Apple iPad 1 / 2 / iPad Mini", | 365 ["Apple iPad 1 / 2 / iPad Mini", |
367 "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", | 366 "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", |
368 "1024x768x1x0x1"], | 367 "1024x768x1x1"], |
369 ["Apple iPad 3 / 4", | 368 ["Apple iPad 3 / 4", |
370 "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", | 369 "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", |
371 "2048x1536x2x0x1"], | 370 "2048x1536x2x1"], |
372 ["BlackBerry PlayBook", | 371 ["BlackBerry PlayBook", |
373 "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+", | 372 "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+", |
374 "1024x600x1x0x1"], | 373 "1024x600x1x1"], |
375 ["Google Nexus 10", | 374 ["Google Nexus 10", |
376 "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", | 375 "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", |
377 "2560x1600x2x1x1"], | 376 "2560x1600x2x1"], |
378 ["Google Nexus 7 2", | 377 ["Google Nexus 7 2", |
379 "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", | 378 "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", |
380 "1920x1200x2x1x1"], | 379 "1920x1200x2x1"], |
381 ["Google Nexus 7", | 380 ["Google Nexus 7", |
382 "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", | 381 "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", |
383 "1280x800x1.325x1x1"], | 382 "1280x800x1.325x1"], |
384 ["Motorola Xoom, Xyboard", | 383 ["Motorola Xoom, Xyboard", |
385 "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", | 384 "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", |
386 "1280x800x1x1x1"], | 385 "1280x800x1x1"], |
387 ["Samsung Galaxy Tab 7.7, 8.9, 10.1", | 386 ["Samsung Galaxy Tab 7.7, 8.9, 10.1", |
388 "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", | 387 "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", |
389 "1280x800x1x1x1"], | 388 "1280x800x1x1"], |
390 ["Samsung Galaxy Tab", | 389 ["Samsung Galaxy Tab", |
391 "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", | 390 "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", |
392 "1024x600x1x1x1"], | 391 "1024x600x1x1"], |
393 ]; | 392 ]; |
394 | 393 |
395 WebInspector.OverridesView.DeviceTab.prototype = { | 394 WebInspector.OverridesView.DeviceTab.prototype = { |
396 /** | 395 /** |
397 * @param {Event} e | 396 * @param {Event} e |
398 */ | 397 */ |
399 _keyPressed: function(e) | 398 _keyPressed: function(e) |
400 { | 399 { |
401 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) | 400 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) |
402 this._emulateButtonClicked(); | 401 this._emulateButtonClicked(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 | 445 |
447 const metricsSetting = WebInspector.settings.deviceMetrics.get(); | 446 const metricsSetting = WebInspector.settings.deviceMetrics.get(); |
448 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(metri csSetting); | 447 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(metri csSetting); |
449 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulate sc reen"), WebInspector.settings.overrideDeviceMetrics, this._onMetricsCheckboxClic ked.bind(this)); | 448 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulate sc reen"), WebInspector.settings.overrideDeviceMetrics, this._onMetricsCheckboxClic ked.bind(this)); |
450 checkbox.firstChild.disabled = WebInspector.isInspectingDevice(); | 449 checkbox.firstChild.disabled = WebInspector.isInspectingDevice(); |
451 WebInspector.settings.deviceMetrics.addChangeListener(this._updateDeviceMetr icsElement, this); | 450 WebInspector.settings.deviceMetrics.addChangeListener(this._updateDeviceMetr icsElement, this); |
452 | 451 |
453 this.element.appendChild(checkbox); | 452 this.element.appendChild(checkbox); |
454 this.element.appendChild(this._createDeviceMetricsElement(metrics)); | 453 this.element.appendChild(this._createDeviceMetricsElement(metrics)); |
455 this.element.appendChild(this._createMediaEmulationElement()); | 454 this.element.appendChild(this._createMediaEmulationElement()); |
455 | |
456 var footnote = this.element.createChild("p", "help-footnote"); | |
457 var footnoteLink = footnote.createChild("a"); | |
458 footnoteLink.href = "https://developers.google.com/chrome-developer-tools/do cs/mobile-emulation"; | |
459 footnoteLink.target = "_blank"; | |
460 footnoteLink.createTextChild(WebInspector.UIString("More information about s creen emulation")); | |
461 | |
456 this._onMetricsCheckboxClicked(WebInspector.settings.overrideDeviceMetrics.g et()); | 462 this._onMetricsCheckboxClicked(WebInspector.settings.overrideDeviceMetrics.g et()); |
457 } | 463 } |
458 | 464 |
459 WebInspector.OverridesView.ViewportTab.prototype = { | 465 WebInspector.OverridesView.ViewportTab.prototype = { |
460 /** | 466 /** |
461 * @param {boolean} enabled | 467 * @param {boolean} enabled |
462 */ | 468 */ |
463 _onMetricsCheckboxClicked: function(enabled) | 469 _onMetricsCheckboxClicked: function(enabled) |
464 { | 470 { |
465 if (enabled && !this._widthOverrideElement.value) | 471 if (enabled && !this._widthOverrideElement.value) |
466 this._widthOverrideElement.focus(); | 472 this._widthOverrideElement.focus(); |
467 }, | 473 }, |
468 | 474 |
469 _applyDeviceMetricsUserInput: function() | 475 _applyDeviceMetricsUserInput: function() |
470 { | 476 { |
471 this._muteRangeListener = true; | 477 this._muteRangeListener = true; |
472 this._widthRangeInput.value = this._widthOverrideElement.value; | 478 this._widthRangeInput.value = this._widthOverrideElement.value; |
473 delete this._muteRangeListener; | 479 delete this._muteRangeListener; |
474 if (this._applyDeviceMetricsTimer) | 480 if (this._applyDeviceMetricsTimer) |
475 clearTimeout(this._applyDeviceMetricsTimer); | 481 clearTimeout(this._applyDeviceMetricsTimer); |
476 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse rInput.bind(this), 50); | 482 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse rInput.bind(this), 50); |
477 }, | 483 }, |
478 | 484 |
479 _doApplyDeviceMetricsUserInput: function() | 485 _doApplyDeviceMetricsUserInput: function() |
480 { | 486 { |
481 delete this._applyDeviceMetricsTimer; | 487 delete this._applyDeviceMetricsTimer; |
482 this._setDeviceMetricsOverride(WebInspector.OverridesSupport.DeviceMetri cs.parseUserInput(this._widthOverrideElement.value.trim(), this._heightOverrideE lement.value.trim(), this._deviceScaleFactorOverrideElement.value.trim(), this._ textAutosizingOverrideCheckbox.checked, this._useAndroidFontMetricsCheckbox.chec ked), true); | 488 this._setDeviceMetricsOverride(WebInspector.OverridesSupport.DeviceMetri cs.parseUserInput(this._widthOverrideElement.value.trim(), this._heightOverrideE lement.value.trim(), this._deviceScaleFactorOverrideElement.value.trim(), this._ textAutosizingOverrideCheckbox.checked), true); |
483 }, | 489 }, |
484 | 490 |
485 /** | 491 /** |
486 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics | 492 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics |
487 * @param {boolean} userInputModified | 493 * @param {boolean} userInputModified |
488 */ | 494 */ |
489 _setDeviceMetricsOverride: function(metrics, userInputModified) | 495 _setDeviceMetricsOverride: function(metrics, userInputModified) |
490 { | 496 { |
491 function setValid(condition, element) | 497 function setValid(condition, element) |
492 { | 498 { |
493 if (condition) | 499 if (condition) |
494 element.removeStyleClass("error-input"); | 500 element.removeStyleClass("error-input"); |
495 else | 501 else |
496 element.addStyleClass("error-input"); | 502 element.addStyleClass("error-input"); |
497 } | 503 } |
498 | 504 |
499 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement); | 505 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement); |
500 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement ); | 506 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement ); |
501 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal eFactorOverrideElement); | 507 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal eFactorOverrideElement); |
502 | 508 |
503 if (!metrics) | 509 if (!metrics) |
504 return; | 510 return; |
505 | 511 |
506 if (!userInputModified) { | 512 if (!userInputModified) { |
507 this._widthOverrideElement.value = metrics.widthToInput(); | 513 this._widthOverrideElement.value = metrics.widthToInput(); |
508 this._heightOverrideElement.value = metrics.heightToInput(); | 514 this._heightOverrideElement.value = metrics.heightToInput(); |
509 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctorToInput(); | 515 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctorToInput(); |
510 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g; | 516 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g; |
511 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFont Metrics; | |
512 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidF ontMetricsDisabled(); | |
513 } | 517 } |
514 | 518 |
515 if (metrics.isValid()) { | 519 if (metrics.isValid()) { |
516 var value = metrics.toSetting(); | 520 var value = metrics.toSetting(); |
517 if (value !== WebInspector.settings.deviceMetrics.get()) | 521 if (value !== WebInspector.settings.deviceMetrics.get()) |
518 WebInspector.settings.deviceMetrics.set(value); | 522 WebInspector.settings.deviceMetrics.set(value); |
519 } | 523 } |
520 }, | 524 }, |
521 | 525 |
522 /** | 526 /** |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
560 this._widthRangeInput.addEventListener("change", this._rangeValueChanged .bind(this), false); | 564 this._widthRangeInput.addEventListener("change", this._rangeValueChanged .bind(this), false); |
561 this._widthRangeInput.value = this._widthOverrideElement.value; | 565 this._widthRangeInput.value = this._widthOverrideElement.value; |
562 | 566 |
563 rowElement = tableElement.createChild("tr"); | 567 rowElement = tableElement.createChild("tr"); |
564 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels."); | 568 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels."); |
565 cellElement = rowElement.createChild("td"); | 569 cellElement = rowElement.createChild("td"); |
566 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D evice pixel ratio:"))); | 570 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D evice pixel ratio:"))); |
567 cellElement = rowElement.createChild("td"); | 571 cellElement = rowElement.createChild("td"); |
568 this._deviceScaleFactorOverrideElement = this._createInput(cellElement, "metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a pplyDeviceMetricsUserInput.bind(this), true); | 572 this._deviceScaleFactorOverrideElement = this._createInput(cellElement, "metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a pplyDeviceMetricsUserInput.bind(this), true); |
569 | 573 |
570 var textAutosizingOverrideElement = this._createNonPersistedCheckbox(Web Inspector.UIString("Enable text autosizing"), this._applyDeviceMetricsUserInput. bind(this)); | 574 var textAutosizingOverrideElement = this._createNonPersistedCheckbox(Web Inspector.UIString("Enable text autosizing "), this._applyDeviceMetricsUserInput .bind(this)); |
571 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi zing is the feature that boosts font sizes on mobile devices."); | 575 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi zing is the feature that boosts font sizes on mobile devices."); |
572 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.fir stChild; | 576 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.fir stChild; |
573 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing; | 577 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing; |
574 fieldsetElement.appendChild(textAutosizingOverrideElement); | 578 fieldsetElement.appendChild(textAutosizingOverrideElement); |
575 | 579 |
576 var androidFontMetricsFieldset = document.createElement("fieldset"); | |
577 androidFontMetricsFieldset.title = WebInspector.UIString("Android artifi cially increases the font metrics used by text autosizing based on the system se ttings and screen size."); | |
578 var useAndroidFontMetricsElement = this._createNonPersistedCheckbox(WebI nspector.UIString("Use Android font metrics"), this._applyDeviceMetricsUserInput .bind(this)); | |
579 this._useAndroidFontMetricsCheckbox = useAndroidFontMetricsElement.first Child; | |
580 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFontMetr ics; | |
581 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidFontM etricsDisabled(); | |
582 androidFontMetricsFieldset.appendChild(useAndroidFontMetricsElement); | |
583 fieldsetElement.appendChild(androidFontMetricsFieldset); | |
584 | |
585 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat e viewport"), WebInspector.settings.emulateViewport); | 580 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat e viewport"), WebInspector.settings.emulateViewport); |
586 fieldsetElement.appendChild(checkbox); | 581 fieldsetElement.appendChild(checkbox); |
587 | 582 |
588 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.settings.deviceFitWindow); | 583 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.settings.deviceFitWindow); |
589 fieldsetElement.appendChild(checkbox); | 584 fieldsetElement.appendChild(checkbox); |
590 | 585 |
591 return fieldsetElement; | 586 return fieldsetElement; |
592 }, | 587 }, |
593 | 588 |
594 _updateDeviceMetricsElement: function() | 589 _updateDeviceMetricsElement: function() |
595 { | 590 { |
596 const metricsSetting = WebInspector.settings.deviceMetrics.get(); | 591 const metricsSetting = WebInspector.settings.deviceMetrics.get(); |
597 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m etricsSetting); | 592 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m etricsSetting); |
598 | 593 |
599 if (this._widthOverrideElement.value !== metrics.width) | 594 if (this._widthOverrideElement.value !== metrics.width) |
600 this._widthOverrideElement.value = metrics.width || screen.width; | 595 this._widthOverrideElement.value = metrics.width || screen.width; |
601 this._muteRangeListener = true; | 596 this._muteRangeListener = true; |
602 if (this._widthRangeInput.value != metrics.width) | 597 if (this._widthRangeInput.value != metrics.width) |
603 this._widthRangeInput.value = metrics.width || screen.width; | 598 this._widthRangeInput.value = metrics.width || screen.width; |
604 delete this._muteRangeListener; | 599 delete this._muteRangeListener; |
605 if (this._heightOverrideElement.value !== metrics.height) | 600 if (this._heightOverrideElement.value !== metrics.height) |
606 this._heightOverrideElement.value = metrics.height || screen.height; | 601 this._heightOverrideElement.value = metrics.height || screen.height; |
607 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale Factor) | 602 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale Factor) |
608 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctor || 1; | 603 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctor || 1; |
609 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz ing) | 604 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz ing) |
610 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g || false; | 605 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g || false; |
611 if (this._useAndroidFontMetricsCheckbox.checked !== metrics.useAndroidFo ntMetrics) | |
612 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFont Metrics || false; | |
613 if (this._useAndroidFontMetricsCheckbox.disabled !== metrics.isUseAndroi dFontMetricsDisabled()) | |
614 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidF ontMetricsDisabled(); | |
615 }, | 606 }, |
616 | 607 |
617 _createMediaEmulationElement: function() | 608 _createMediaEmulationElement: function() |
618 { | 609 { |
619 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true); | 610 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true); |
620 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web Inspector.settings.overrideCSSMedia); | 611 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web Inspector.settings.overrideCSSMedia); |
621 fieldsetElement.disabled = WebInspector.isInspectingDevice(); | 612 fieldsetElement.disabled = WebInspector.isInspectingDevice(); |
622 checkbox.appendChild(fieldsetElement); | 613 checkbox.appendChild(fieldsetElement); |
623 | 614 |
624 var mediaSelectElement = fieldsetElement.createChild("select"); | 615 var mediaSelectElement = fieldsetElement.createChild("select"); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
957 cellElement.appendChild(document.createTextNode(" \u03B2: ")); | 948 cellElement.appendChild(document.createTextNode(" \u03B2: ")); |
958 this._betaElement = this._createInput(cellElement, "device-orientation-o verride-beta", String(deviceOrientation.beta), this._applyDeviceOrientationUserI nput.bind(this), true); | 949 this._betaElement = this._createInput(cellElement, "device-orientation-o verride-beta", String(deviceOrientation.beta), this._applyDeviceOrientationUserI nput.bind(this), true); |
959 cellElement.appendChild(document.createTextNode(" \u03B3: ")); | 950 cellElement.appendChild(document.createTextNode(" \u03B3: ")); |
960 this._gammaElement = this._createInput(cellElement, "device-orientation- override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs erInput.bind(this), true); | 951 this._gammaElement = this._createInput(cellElement, "device-orientation- override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs erInput.bind(this), true); |
961 | 952 |
962 return fieldsetElement; | 953 return fieldsetElement; |
963 } | 954 } |
964 } | 955 } |
965 | 956 |
966 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid esView.Tab.prototype; | 957 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid esView.Tab.prototype; |
OLD | NEW |