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. |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 this._widthRangeInput.value = this._widthOverrideElement.value; | 471 this._widthRangeInput.value = this._widthOverrideElement.value; |
473 delete this._muteRangeListener; | 472 delete this._muteRangeListener; |
474 if (this._applyDeviceMetricsTimer) | 473 if (this._applyDeviceMetricsTimer) |
475 clearTimeout(this._applyDeviceMetricsTimer); | 474 clearTimeout(this._applyDeviceMetricsTimer); |
476 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse
rInput.bind(this), 50); | 475 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse
rInput.bind(this), 50); |
477 }, | 476 }, |
478 | 477 |
479 _doApplyDeviceMetricsUserInput: function() | 478 _doApplyDeviceMetricsUserInput: function() |
480 { | 479 { |
481 delete this._applyDeviceMetricsTimer; | 480 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); | 481 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 }, | 482 }, |
484 | 483 |
485 /** | 484 /** |
486 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics | 485 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics |
487 * @param {boolean} userInputModified | 486 * @param {boolean} userInputModified |
488 */ | 487 */ |
489 _setDeviceMetricsOverride: function(metrics, userInputModified) | 488 _setDeviceMetricsOverride: function(metrics, userInputModified) |
490 { | 489 { |
491 function setValid(condition, element) | 490 function setValid(condition, element) |
492 { | 491 { |
493 if (condition) | 492 if (condition) |
494 element.removeStyleClass("error-input"); | 493 element.removeStyleClass("error-input"); |
495 else | 494 else |
496 element.addStyleClass("error-input"); | 495 element.addStyleClass("error-input"); |
497 } | 496 } |
498 | 497 |
499 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement); | 498 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement); |
500 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement
); | 499 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement
); |
501 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal
eFactorOverrideElement); | 500 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal
eFactorOverrideElement); |
502 | 501 |
503 if (!metrics) | 502 if (!metrics) |
504 return; | 503 return; |
505 | 504 |
506 if (!userInputModified) { | 505 if (!userInputModified) { |
507 this._widthOverrideElement.value = metrics.widthToInput(); | 506 this._widthOverrideElement.value = metrics.widthToInput(); |
508 this._heightOverrideElement.value = metrics.heightToInput(); | 507 this._heightOverrideElement.value = metrics.heightToInput(); |
509 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa
ctorToInput(); | 508 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa
ctorToInput(); |
510 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin
g; | 509 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin
g; |
511 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFont
Metrics; | |
512 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidF
ontMetricsDisabled(); | |
513 } | 510 } |
514 | 511 |
515 if (metrics.isValid()) { | 512 if (metrics.isValid()) { |
516 var value = metrics.toSetting(); | 513 var value = metrics.toSetting(); |
517 if (value !== WebInspector.settings.deviceMetrics.get()) | 514 if (value !== WebInspector.settings.deviceMetrics.get()) |
518 WebInspector.settings.deviceMetrics.set(value); | 515 WebInspector.settings.deviceMetrics.set(value); |
519 } | 516 } |
520 }, | 517 }, |
521 | 518 |
522 /** | 519 /** |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 this._widthRangeInput.addEventListener("change", this._rangeValueChanged
.bind(this), false); | 557 this._widthRangeInput.addEventListener("change", this._rangeValueChanged
.bind(this), false); |
561 this._widthRangeInput.value = this._widthOverrideElement.value; | 558 this._widthRangeInput.value = this._widthOverrideElement.value; |
562 | 559 |
563 rowElement = tableElement.createChild("tr"); | 560 rowElement = tableElement.createChild("tr"); |
564 rowElement.title = WebInspector.UIString("Ratio between a device's physi
cal pixels and device-independent pixels."); | 561 rowElement.title = WebInspector.UIString("Ratio between a device's physi
cal pixels and device-independent pixels."); |
565 cellElement = rowElement.createChild("td"); | 562 cellElement = rowElement.createChild("td"); |
566 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D
evice pixel ratio:"))); | 563 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D
evice pixel ratio:"))); |
567 cellElement = rowElement.createChild("td"); | 564 cellElement = rowElement.createChild("td"); |
568 this._deviceScaleFactorOverrideElement = this._createInput(cellElement,
"metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a
pplyDeviceMetricsUserInput.bind(this), true); | 565 this._deviceScaleFactorOverrideElement = this._createInput(cellElement,
"metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a
pplyDeviceMetricsUserInput.bind(this), true); |
569 | 566 |
570 var textAutosizingOverrideElement = this._createNonPersistedCheckbox(Web
Inspector.UIString("Enable text autosizing"), this._applyDeviceMetricsUserInput.
bind(this)); | 567 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."); | 568 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi
zing is the feature that boosts font sizes on mobile devices."); |
572 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.fir
stChild; | 569 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.fir
stChild; |
573 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing; | 570 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing; |
| 571 var textAutosizingMoreInfo = document.createElement('a'); |
| 572 textAutosizingMoreInfo.textContent = WebInspector.UIString("Learn more")
; |
| 573 textAutosizingMoreInfo.href = "https://code.google.com/p/chromium/wiki/E
mulatingTextAutosizing"; |
| 574 textAutosizingOverrideElement.appendChild(textAutosizingMoreInfo); |
574 fieldsetElement.appendChild(textAutosizingOverrideElement); | 575 fieldsetElement.appendChild(textAutosizingOverrideElement); |
575 | 576 |
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); | 577 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat
e viewport"), WebInspector.settings.emulateViewport); |
586 fieldsetElement.appendChild(checkbox); | 578 fieldsetElement.appendChild(checkbox); |
587 | 579 |
588 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to
fit"), WebInspector.settings.deviceFitWindow); | 580 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to
fit"), WebInspector.settings.deviceFitWindow); |
589 fieldsetElement.appendChild(checkbox); | 581 fieldsetElement.appendChild(checkbox); |
590 | 582 |
591 return fieldsetElement; | 583 return fieldsetElement; |
592 }, | 584 }, |
593 | 585 |
594 _updateDeviceMetricsElement: function() | 586 _updateDeviceMetricsElement: function() |
595 { | 587 { |
596 const metricsSetting = WebInspector.settings.deviceMetrics.get(); | 588 const metricsSetting = WebInspector.settings.deviceMetrics.get(); |
597 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m
etricsSetting); | 589 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m
etricsSetting); |
598 | 590 |
599 if (this._widthOverrideElement.value !== metrics.width) | 591 if (this._widthOverrideElement.value !== metrics.width) |
600 this._widthOverrideElement.value = metrics.width || screen.width; | 592 this._widthOverrideElement.value = metrics.width || screen.width; |
601 this._muteRangeListener = true; | 593 this._muteRangeListener = true; |
602 if (this._widthRangeInput.value != metrics.width) | 594 if (this._widthRangeInput.value != metrics.width) |
603 this._widthRangeInput.value = metrics.width || screen.width; | 595 this._widthRangeInput.value = metrics.width || screen.width; |
604 delete this._muteRangeListener; | 596 delete this._muteRangeListener; |
605 if (this._heightOverrideElement.value !== metrics.height) | 597 if (this._heightOverrideElement.value !== metrics.height) |
606 this._heightOverrideElement.value = metrics.height || screen.height; | 598 this._heightOverrideElement.value = metrics.height || screen.height; |
607 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale
Factor) | 599 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale
Factor) |
608 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa
ctor || 1; | 600 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa
ctor || 1; |
609 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz
ing) | 601 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz
ing) |
610 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin
g || false; | 602 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 }, | 603 }, |
616 | 604 |
617 _createMediaEmulationElement: function() | 605 _createMediaEmulationElement: function() |
618 { | 606 { |
619 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect
or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true); | 607 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect
or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true); |
620 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web
Inspector.settings.overrideCSSMedia); | 608 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web
Inspector.settings.overrideCSSMedia); |
621 fieldsetElement.disabled = WebInspector.isInspectingDevice(); | 609 fieldsetElement.disabled = WebInspector.isInspectingDevice(); |
622 checkbox.appendChild(fieldsetElement); | 610 checkbox.appendChild(fieldsetElement); |
623 | 611 |
624 var mediaSelectElement = fieldsetElement.createChild("select"); | 612 var mediaSelectElement = fieldsetElement.createChild("select"); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 cellElement.appendChild(document.createTextNode(" \u03B2: ")); | 945 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); | 946 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: ")); | 947 cellElement.appendChild(document.createTextNode(" \u03B3: ")); |
960 this._gammaElement = this._createInput(cellElement, "device-orientation-
override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs
erInput.bind(this), true); | 948 this._gammaElement = this._createInput(cellElement, "device-orientation-
override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs
erInput.bind(this), true); |
961 | 949 |
962 return fieldsetElement; | 950 return fieldsetElement; |
963 } | 951 } |
964 } | 952 } |
965 | 953 |
966 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid
esView.Tab.prototype; | 954 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid
esView.Tab.prototype; |
OLD | NEW |