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

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

Issue 25735003: Add text autosizing override in the inspector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typeo Created 7 years, 2 months 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/core/page/Settings.cpp ('k') | Source/devtools/front_end/OverridesView.js » ('j') | 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 WebInspector.settings.overrideGeolocation.addChangeListener(this._geolocatio nPositionChanged, this); 46 WebInspector.settings.overrideGeolocation.addChangeListener(this._geolocatio nPositionChanged, this);
47 WebInspector.settings.geolocationOverride.addChangeListener(this._geolocatio nPositionChanged, this); 47 WebInspector.settings.geolocationOverride.addChangeListener(this._geolocatio nPositionChanged, this);
48 48
49 WebInspector.settings.overrideDeviceOrientation.addChangeListener(this._devi ceOrientationChanged, this); 49 WebInspector.settings.overrideDeviceOrientation.addChangeListener(this._devi ceOrientationChanged, this);
50 WebInspector.settings.deviceOrientationOverride.addChangeListener(this._devi ceOrientationChanged, this); 50 WebInspector.settings.deviceOrientationOverride.addChangeListener(this._devi ceOrientationChanged, this);
51 51
52 WebInspector.settings.emulateTouchEvents.addChangeListener(this._emulateTouc hEventsChanged, this); 52 WebInspector.settings.emulateTouchEvents.addChangeListener(this._emulateTouc hEventsChanged, this);
53 53
54 WebInspector.settings.overrideCSSMedia.addChangeListener(this._cssMediaChang ed, this); 54 WebInspector.settings.overrideCSSMedia.addChangeListener(this._cssMediaChang ed, this);
55 WebInspector.settings.emulatedCSSMedia.addChangeListener(this._cssMediaChang ed, this); 55 WebInspector.settings.emulatedCSSMedia.addChangeListener(this._cssMediaChang ed, this);
56
57 WebInspector.settings.overrideTextAutosizing.addChangeListener(this._textAut osizingChanged, this);
58 WebInspector.settings.enableTextAutosizing.addChangeListener(this._textAutos izingChanged, this);
56 } 59 }
57 60
58 /** 61 /**
59 * @constructor 62 * @constructor
60 * @param {number} width 63 * @param {number} width
61 * @param {number} height 64 * @param {number} height
62 * @param {number} fontScaleFactor 65 * @param {number} fontScaleFactor
63 */ 66 */
64 WebInspector.OverridesSupport.DeviceMetrics = function(width, height, fontScaleF actor) 67 WebInspector.OverridesSupport.DeviceMetrics = function(width, height, fontScaleF actor)
65 { 68 {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 }, 332 },
330 333
331 _updateAllOverrides: function() 334 _updateAllOverrides: function()
332 { 335 {
333 this._userAgentChanged(); 336 this._userAgentChanged();
334 this._deviceMetricsChanged(); 337 this._deviceMetricsChanged();
335 this._deviceOrientationChanged(); 338 this._deviceOrientationChanged();
336 this._geolocationPositionChanged(); 339 this._geolocationPositionChanged();
337 this._emulateTouchEventsChanged(); 340 this._emulateTouchEventsChanged();
338 this._cssMediaChanged(); 341 this._cssMediaChanged();
342 this._textAutosizingChanged();
339 }, 343 },
340 344
341 _userAgentChanged: function() 345 _userAgentChanged: function()
342 { 346 {
343 NetworkAgent.setUserAgentOverride(this._overridesActive && WebInspector. settings.overrideUserAgent.get() ? WebInspector.settings.userAgent.get() : ""); 347 NetworkAgent.setUserAgentOverride(this._overridesActive && WebInspector. settings.overrideUserAgent.get() ? WebInspector.settings.userAgent.get() : "");
344 }, 348 },
345 349
346 _deviceMetricsChanged: function() 350 _deviceMetricsChanged: function()
347 { 351 {
348 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(t his._overridesActive && WebInspector.settings.overrideDeviceMetrics.get() ? WebI nspector.settings.deviceMetrics.get() : ""); 352 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(t his._overridesActive && WebInspector.settings.overrideDeviceMetrics.get() ? WebI nspector.settings.deviceMetrics.get() : "");
(...skipping 26 matching lines...) Expand all
375 379
376 _emulateTouchEventsChanged: function() 380 _emulateTouchEventsChanged: function()
377 { 381 {
378 WebInspector.domAgent.emulateTouchEventObjects(this._overridesActive && WebInspector.settings.emulateTouchEvents.get()); 382 WebInspector.domAgent.emulateTouchEventObjects(this._overridesActive && WebInspector.settings.emulateTouchEvents.get());
379 }, 383 },
380 384
381 _cssMediaChanged: function() 385 _cssMediaChanged: function()
382 { 386 {
383 PageAgent.setEmulatedMedia(this._overridesActive && WebInspector.setting s.overrideCSSMedia.get() ? WebInspector.settings.emulatedCSSMedia.get() : ""); 387 PageAgent.setEmulatedMedia(this._overridesActive && WebInspector.setting s.overrideCSSMedia.get() ? WebInspector.settings.emulatedCSSMedia.get() : "");
384 WebInspector.cssModel.mediaQueryResultChanged(); 388 WebInspector.cssModel.mediaQueryResultChanged();
389 },
390
391 _textAutosizingChanged: function()
392 {
393 if (!this._overridesActive || !WebInspector.settings.overrideTextAutosiz ing.get()) {
394 PageAgent.clearTextAutosizingOverride();
395 return;
396 }
397 PageAgent.setTextAutosizingOverride(WebInspector.settings.enableTextAuto sizing.get());
385 } 398 }
386 } 399 }
387 400
388 401
389 /** 402 /**
390 * @type {WebInspector.OverridesSupport} 403 * @type {WebInspector.OverridesSupport}
391 */ 404 */
392 WebInspector.overridesSupport; 405 WebInspector.overridesSupport;
OLDNEW
« no previous file with comments | « Source/core/page/Settings.cpp ('k') | Source/devtools/front_end/OverridesView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698