Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/devtools/front_end/OverridesView.js

Issue 73203003: Refactor how font scale factor appears in the emulation panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update per reviewer comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/OverridesSupport.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // - font scale factor, or 0 to compute one (see: WebInspector.OverridesSupport. DeviceMetrics.computeFontScaleFactorForAndroid). 264 // - use android font metrics,
265 // - text autosizing. 265 // - use text autosizing.
266 WebInspector.OverridesView.DeviceTab._phones = [ 266 WebInspector.OverridesView.DeviceTab._phones = [
267 ["Apple iPhone 3GS", 267 ["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", 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",
269 "320x480x1x1x1"], 269 "320x480x1x0x1"],
270 ["Apple iPhone 4", 270 ["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", 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",
272 "640x960x2x1x1"], 272 "640x960x2x0x1"],
273 ["Apple iPhone 5", 273 ["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", 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",
275 "640x1136x2x1x1"], 275 "640x1136x2x0x1"],
276 ["BlackBerry Z10", 276 ["BlackBerry Z10",
277 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", 277 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+",
278 "768x1280x2x1x1"], 278 "768x1280x2x0x1"],
279 ["BlackBerry Z30", 279 ["BlackBerry Z30",
280 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+", 280 "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ 10.0.9.2372 Mobile Safari/537.10+",
281 "720x1280x2x1x1"], 281 "720x1280x2x0x1"],
282 ["Google Nexus 4", 282 ["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", 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",
284 "768x1280x2x0x1"], 284 "768x1280x2x1x1"],
285 ["Google Nexus 5", 285 ["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", 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",
287 "1080x1920x3x0x1"], 287 "1080x1920x3x1x1"],
288 ["Google Nexus S", 288 ["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", 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",
290 "480x800x1.5x0x1"], 290 "480x800x1.5x1x1"],
291 ["HTC Evo, Touch HD, Desire HD, Desire", 291 ["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", 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",
293 "480x800x1.5x0x1"], 293 "480x800x1.5x1x1"],
294 ["HTC One X, EVO LTE", 294 ["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", 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",
296 "720x1280x2x0x1"], 296 "720x1280x2x1x1"],
297 ["HTC Sensation, Evo 3D", 297 ["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", 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",
299 "540x960x1.5x0x1"], 299 "540x960x1.5x1x1"],
300 ["LG Optimus 2X, Optimus 3D, Optimus Black", 300 ["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", 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",
302 "480x800x1.5x0x1"], 302 "480x800x1.5x1x1"],
303 ["LG Optimus G", 303 ["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", 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",
305 "768x1280x2x0x1"], 305 "768x1280x2x1x1"],
306 ["LG Optimus LTE, Optimus 4X HD", 306 ["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", 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",
308 "720x1280x1.7x0x1"], 308 "720x1280x1.7x1x1"],
309 ["LG Optimus One", 309 ["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", 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",
311 "320x480x1.5x0x1"], 311 "320x480x1.5x1x1"],
312 ["Motorola Defy, Droid, Droid X, Milestone", 312 ["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", 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",
314 "480x854x1.5x0x1"], 314 "480x854x1.5x1x1"],
315 ["Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2", 315 ["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", 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",
317 "540x960x1x0x1"], 317 "540x960x1x1x1"],
318 ["Motorola Droid Razr HD", 318 ["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", 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",
320 "720x1280x1x0x1"], 320 "720x1280x1x1x1"],
321 ["Nokia C5, C6, C7, N97, N8, X7", 321 ["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", 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",
323 "360x640x1x1x1"], 323 "360x640x1x0x1"],
324 ["Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900", 324 ["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)", 325 "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.5x1x1"], 326 "480x800x1.5x0x1"],
327 ["Samsung Galaxy Note 3", 327 ["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", 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",
329 "1080x1920x2x0x1"], 329 "1080x1920x2x1x1"],
330 ["Samsung Galaxy Note II", 330 ["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", 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",
332 "720x1280x2x0x1"], 332 "720x1280x2x1x1"],
333 ["Samsung Galaxy Note", 333 ["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", 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",
335 "800x1280x2x0x1"], 335 "800x1280x2x1x1"],
336 ["Samsung Galaxy S III, Galaxy Nexus", 336 ["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", 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",
338 "720x1280x2x0x1"], 338 "720x1280x2x1x1"],
339 ["Samsung Galaxy S, S II, W", 339 ["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", 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",
341 "480x800x1.5x0x1"], 341 "480x800x1.5x1x1"],
342 ["Samsung Galaxy S4", 342 ["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", 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",
344 "1080x1920x3x0x1"], 344 "1080x1920x3x1x1"],
345 ["Sony Xperia S, Ion", 345 ["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", 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",
347 "720x1280x2x0x1"], 347 "720x1280x2x1x1"],
348 ["Sony Xperia Sola, U", 348 ["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", 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",
350 "480x854x1x0x1"], 350 "480x854x1x1x1"],
351 ["Sony Xperia Z, Z1", 351 ["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", 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",
353 "1080x1920x3x0x1"], 353 "1080x1920x3x1x1"],
354 ]; 354 ];
355 355
356 WebInspector.OverridesView.DeviceTab._tablets = [ 356 WebInspector.OverridesView.DeviceTab._tablets = [
357 ["Amazon Amazon Kindle Fire HD 7\"", 357 ["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", 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",
359 "1280x800x1.5x0x1"], 359 "1280x800x1.5x1x1"],
360 ["Amazon Amazon Kindle Fire HD 8.9\"", 360 ["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", 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",
362 "1920x1200x1.5x0x1"], 362 "1920x1200x1.5x1x1"],
363 ["Amazon Amazon Kindle Fire", 363 ["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", 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",
365 "1024x600x1x0x1"], 365 "1024x600x1x1x1"],
366 ["Apple iPad 1 / 2 / iPad Mini", 366 ["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", 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",
368 "1024x768x1x1x1"], 368 "1024x768x1x0x1"],
369 ["Apple iPad 3 / 4", 369 ["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", 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",
371 "2048x1536x2x1x1"], 371 "2048x1536x2x0x1"],
372 ["BlackBerry PlayBook", 372 ["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+", 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+",
374 "1024x600x1x1x1"], 374 "1024x600x1x0x1"],
375 ["Google Nexus 10", 375 ["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", 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",
377 "2560x1600x2x0x1"], 377 "2560x1600x2x1x1"],
378 ["Google Nexus 7 2", 378 ["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", 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",
380 "1920x1200x2x0x1"], 380 "1920x1200x2x1x1"],
381 ["Google Nexus 7", 381 ["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", 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",
383 "1280x800x1.325x0x1"], 383 "1280x800x1.325x1x1"],
384 ["Motorola Xoom, Xyboard", 384 ["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", 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",
386 "1280x800x1x0x1"], 386 "1280x800x1x1x1"],
387 ["Samsung Galaxy Tab 7.7, 8.9, 10.1", 387 ["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", 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",
389 "1280x800x1x0x1"], 389 "1280x800x1x1x1"],
390 ["Samsung Galaxy Tab", 390 ["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", 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",
392 "1024x600x1x0x1"], 392 "1024x600x1x1x1"],
393 ]; 393 ];
394 394
395 WebInspector.OverridesView.DeviceTab.prototype = { 395 WebInspector.OverridesView.DeviceTab.prototype = {
396 /** 396 /**
397 * @param {Event} e 397 * @param {Event} e
398 */ 398 */
399 _keyPressed: function(e) 399 _keyPressed: function(e)
400 { 400 {
401 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) 401 if (e.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code)
402 this._emulateButtonClicked(); 402 this._emulateButtonClicked();
(...skipping 15 matching lines...) Expand all
418 var option = this._deviceSelectElement.options[this._deviceSelectElement .selectedIndex]; 418 var option = this._deviceSelectElement.options[this._deviceSelectElement .selectedIndex];
419 this._emulatedDeviceSetting.set(option.value); 419 this._emulatedDeviceSetting.set(option.value);
420 this._updateValueLabels(); 420 this._updateValueLabels();
421 }, 421 },
422 422
423 _updateValueLabels: function() 423 _updateValueLabels: function()
424 { 424 {
425 var option = this._deviceSelectElement.options[this._deviceSelectElement .selectedIndex]; 425 var option = this._deviceSelectElement.options[this._deviceSelectElement .selectedIndex];
426 var metrics; 426 var metrics;
427 if (option._metrics && (metrics = WebInspector.OverridesSupport.DeviceMe trics.parseSetting(option._metrics))) 427 if (option._metrics && (metrics = WebInspector.OverridesSupport.DeviceMe trics.parseSetting(option._metrics)))
428 this._viewportValueElement.textContent = WebInspector.UIString("%s \ u00D7 %s, devicePixelRatio = %s, font scale factor = %s", metrics.width, metrics .height, metrics.deviceScaleFactor, metrics.fontScaleFactor); 428 this._viewportValueElement.textContent = WebInspector.UIString("%s \ u00D7 %s, devicePixelRatio = %s", metrics.width, metrics.height, metrics.deviceS caleFactor);
429 else 429 else
430 this._viewportValueElement.textContent = ""; 430 this._viewportValueElement.textContent = "";
431 this._userAgentValueElement.textContent = option._userAgent || ""; 431 this._userAgentValueElement.textContent = option._userAgent || "";
432 } 432 }
433 } 433 }
434 434
435 WebInspector.OverridesView.DeviceTab.prototype.__proto__ = WebInspector.Override sView.Tab.prototype; 435 WebInspector.OverridesView.DeviceTab.prototype.__proto__ = WebInspector.Override sView.Tab.prototype;
436 436
437 437
438 /** 438 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 this._widthRangeInput.value = this._widthOverrideElement.value; 472 this._widthRangeInput.value = this._widthOverrideElement.value;
473 delete this._muteRangeListener; 473 delete this._muteRangeListener;
474 if (this._applyDeviceMetricsTimer) 474 if (this._applyDeviceMetricsTimer)
475 clearTimeout(this._applyDeviceMetricsTimer); 475 clearTimeout(this._applyDeviceMetricsTimer);
476 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse rInput.bind(this), 50); 476 this._applyDeviceMetricsTimer = setTimeout(this._doApplyDeviceMetricsUse rInput.bind(this), 50);
477 }, 477 },
478 478
479 _doApplyDeviceMetricsUserInput: function() 479 _doApplyDeviceMetricsUserInput: function()
480 { 480 {
481 delete this._applyDeviceMetricsTimer; 481 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._ fontScaleFactorOverrideElement.value.trim(), this._textAutosizingOverrideCheckbo x.checked), true); 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);
483 }, 483 },
484 484
485 /** 485 /**
486 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics 486 * @param {?WebInspector.OverridesSupport.DeviceMetrics} metrics
487 * @param {boolean} userInputModified 487 * @param {boolean} userInputModified
488 */ 488 */
489 _setDeviceMetricsOverride: function(metrics, userInputModified) 489 _setDeviceMetricsOverride: function(metrics, userInputModified)
490 { 490 {
491 function setValid(condition, element) 491 function setValid(condition, element)
492 { 492 {
493 if (condition) 493 if (condition)
494 element.removeStyleClass("error-input"); 494 element.removeStyleClass("error-input");
495 else 495 else
496 element.addStyleClass("error-input"); 496 element.addStyleClass("error-input");
497 } 497 }
498 498
499 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement); 499 setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement);
500 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement ); 500 setValid(metrics && metrics.isHeightValid(), this._heightOverrideElement );
501 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal eFactorOverrideElement); 501 setValid(metrics && metrics.isDeviceScaleFactorValid(), this._deviceScal eFactorOverrideElement);
502 setValid(metrics && metrics.isFontScaleFactorValid(), this._fontScaleFac torOverrideElement);
503 setValid(metrics && metrics.isTextAutosizingValid(), this._textAutosizin gOverrideCheckbox);
504 502
505 if (!metrics) 503 if (!metrics)
506 return; 504 return;
507 505
508 if (!userInputModified) { 506 if (!userInputModified) {
509 this._widthOverrideElement.value = metrics.widthToInput(); 507 this._widthOverrideElement.value = metrics.widthToInput();
510 this._heightOverrideElement.value = metrics.heightToInput(); 508 this._heightOverrideElement.value = metrics.heightToInput();
511 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctorToInput(); 509 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctorToInput();
512 this._fontScaleFactorOverrideElement.value = metrics.fontScaleFactor ToInput();
513 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g; 510 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g;
511 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFont Metrics;
512 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidF ontMetricsDisabled();
514 } 513 }
515 514
516 if (metrics.isValid()) { 515 if (metrics.isValid()) {
517 var value = metrics.toSetting(); 516 var value = metrics.toSetting();
518 if (value !== WebInspector.settings.deviceMetrics.get()) 517 if (value !== WebInspector.settings.deviceMetrics.get())
519 WebInspector.settings.deviceMetrics.set(value); 518 WebInspector.settings.deviceMetrics.set(value);
520 } 519 }
521 }, 520 },
522 521
523 /** 522 /**
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 cellElement = rowElement.createChild("td"); 554 cellElement = rowElement.createChild("td");
556 cellElement.colSpan = 4; 555 cellElement.colSpan = 4;
557 this._widthRangeInput = cellElement.createChild("input"); 556 this._widthRangeInput = cellElement.createChild("input");
558 this._widthRangeInput.type = "range"; 557 this._widthRangeInput.type = "range";
559 this._widthRangeInput.min = 100; 558 this._widthRangeInput.min = 100;
560 this._widthRangeInput.max = 2000; 559 this._widthRangeInput.max = 2000;
561 this._widthRangeInput.addEventListener("change", this._rangeValueChanged .bind(this), false); 560 this._widthRangeInput.addEventListener("change", this._rangeValueChanged .bind(this), false);
562 this._widthRangeInput.value = this._widthOverrideElement.value; 561 this._widthRangeInput.value = this._widthOverrideElement.value;
563 562
564 rowElement = tableElement.createChild("tr"); 563 rowElement = tableElement.createChild("tr");
564 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels.");
565 cellElement = rowElement.createChild("td"); 565 cellElement = rowElement.createChild("td");
566 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D evice pixel ratio:"))); 566 cellElement.appendChild(document.createTextNode(WebInspector.UIString("D evice pixel ratio:")));
567 cellElement = rowElement.createChild("td"); 567 cellElement = rowElement.createChild("td");
568 this._deviceScaleFactorOverrideElement = this._createInput(cellElement, "metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a pplyDeviceMetricsUserInput.bind(this), true); 568 this._deviceScaleFactorOverrideElement = this._createInput(cellElement, "metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._a pplyDeviceMetricsUserInput.bind(this), true);
569 this._deviceScaleFactorOverrideElement.title = WebInspector.UIString("Ra tio between a device's physical pixels and device-independent pixels.");
570 569
571 rowElement = tableElement.createChild("tr"); 570 var textAutosizingOverrideElement = this._createNonPersistedCheckbox(Web Inspector.UIString("Enable text autosizing"), this._applyDeviceMetricsUserInput. bind(this));
572 cellElement = rowElement.createChild("td"); 571 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi zing is the feature that boosts font sizes on mobile devices.");
573 cellElement.appendChild(document.createTextNode(WebInspector.UIString("F ont scale factor:"))); 572 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.get ElementsByTagName("input")[0];
pfeldman 2013/11/18 14:45:08 nit: this is no better than textAutosizingOverride
574 cellElement = rowElement.createChild("td"); 573 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing;
575 this._fontScaleFactorOverrideElement = this._createInput(cellElement, "m etrics-override-font-scale", String(metrics.fontScaleFactor || 1), this._applyDe viceMetricsUserInput.bind(this), true); 574 fieldsetElement.appendChild(textAutosizingOverrideElement);
576 this._fontScaleFactorOverrideElement.title = WebInspector.UIString("Scal e factor used on Android. Computed from the physical screen dimensions and syste m font settings."); 575
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.getEl ementsByTagName("input")[0];
580 this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFontMetr ics;
581 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidFontM etricsDisabled();
582 androidFontMetricsFieldset.appendChild(useAndroidFontMetricsElement);
583 fieldsetElement.appendChild(androidFontMetricsFieldset);
577 584
578 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat e viewport"), WebInspector.settings.emulateViewport); 585 var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulat e viewport"), WebInspector.settings.emulateViewport);
579 fieldsetElement.appendChild(checkbox); 586 fieldsetElement.appendChild(checkbox);
580 587
581 var textAutosizingOverrideElement = this._createNonPersistedCheckbox(Web Inspector.UIString("Enable text autosizing"), this._applyDeviceMetricsUserInput. bind(this));
582 this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.get ElementsByTagName("input")[0];
583 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing;
584 fieldsetElement.appendChild(textAutosizingOverrideElement);
585
586 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.settings.deviceFitWindow); 588 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.settings.deviceFitWindow);
587 fieldsetElement.appendChild(checkbox); 589 fieldsetElement.appendChild(checkbox);
588 590
589 return fieldsetElement; 591 return fieldsetElement;
590 }, 592 },
591 593
592 _updateDeviceMetricsElement: function() 594 _updateDeviceMetricsElement: function()
593 { 595 {
594 const metricsSetting = WebInspector.settings.deviceMetrics.get(); 596 const metricsSetting = WebInspector.settings.deviceMetrics.get();
595 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m etricsSetting); 597 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(m etricsSetting);
596 598
597 if (this._widthOverrideElement.value !== metrics.width) 599 if (this._widthOverrideElement.value !== metrics.width)
598 this._widthOverrideElement.value = metrics.width || screen.width; 600 this._widthOverrideElement.value = metrics.width || screen.width;
599 this._muteRangeListener = true; 601 this._muteRangeListener = true;
600 if (this._widthRangeInput.value != metrics.width) 602 if (this._widthRangeInput.value != metrics.width)
601 this._widthRangeInput.value = metrics.width || screen.width; 603 this._widthRangeInput.value = metrics.width || screen.width;
602 delete this._muteRangeListener; 604 delete this._muteRangeListener;
603 if (this._heightOverrideElement.value !== metrics.height) 605 if (this._heightOverrideElement.value !== metrics.height)
604 this._heightOverrideElement.value = metrics.height || screen.height; 606 this._heightOverrideElement.value = metrics.height || screen.height;
605 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale Factor) 607 if (this._deviceScaleFactorOverrideElement.value !== metrics.deviceScale Factor)
606 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctor || 1; 608 this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFa ctor || 1;
607 if (this._fontScaleFactorOverrideElement.value !== metrics.fontScaleFact or)
608 this._fontScaleFactorOverrideElement.value = metrics.fontScaleFactor || 1;
609 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz ing) 609 if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosiz ing)
610 this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizin g || false; 610 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())
pfeldman 2013/11/18 14:45:08 The disabled state of this checkbox needs to be co
614 this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidF ontMetricsDisabled();
611 }, 615 },
612 616
613 _createMediaEmulationElement: function() 617 _createMediaEmulationElement: function()
614 { 618 {
615 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true); 619 var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspect or.UIString("CSS media"), WebInspector.settings.overrideCSSMedia, true);
616 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web Inspector.settings.overrideCSSMedia); 620 var fieldsetElement = WebInspector.SettingsTab.createSettingFieldset(Web Inspector.settings.overrideCSSMedia);
617 fieldsetElement.disabled = WebInspector.isInspectingDevice(); 621 fieldsetElement.disabled = WebInspector.isInspectingDevice();
618 checkbox.appendChild(fieldsetElement); 622 checkbox.appendChild(fieldsetElement);
619 623
620 var mediaSelectElement = fieldsetElement.createChild("select"); 624 var mediaSelectElement = fieldsetElement.createChild("select");
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 cellElement.appendChild(document.createTextNode(" \u03B2: ")); 957 cellElement.appendChild(document.createTextNode(" \u03B2: "));
954 this._betaElement = this._createInput(cellElement, "device-orientation-o verride-beta", String(deviceOrientation.beta), this._applyDeviceOrientationUserI nput.bind(this), true); 958 this._betaElement = this._createInput(cellElement, "device-orientation-o verride-beta", String(deviceOrientation.beta), this._applyDeviceOrientationUserI nput.bind(this), true);
955 cellElement.appendChild(document.createTextNode(" \u03B3: ")); 959 cellElement.appendChild(document.createTextNode(" \u03B3: "));
956 this._gammaElement = this._createInput(cellElement, "device-orientation- override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs erInput.bind(this), true); 960 this._gammaElement = this._createInput(cellElement, "device-orientation- override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUs erInput.bind(this), true);
957 961
958 return fieldsetElement; 962 return fieldsetElement;
959 } 963 }
960 } 964 }
961 965
962 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid esView.Tab.prototype; 966 WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.Overrid esView.Tab.prototype;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/OverridesSupport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698