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

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

Issue 306803004: DevTools: hide emulation bits that are available in responsive design toolbar from the drawer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/devtools/front_end/overrides.css ('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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @implements {WebInspector.TargetManager.Observer} 33 * @implements {WebInspector.TargetManager.Observer}
34 * @extends {WebInspector.Object} 34 * @extends {WebInspector.Object}
35 * @param {boolean} responsiveDesignAvailable
35 */ 36 */
36 WebInspector.OverridesSupport = function() 37 WebInspector.OverridesSupport = function(responsiveDesignAvailable)
37 { 38 {
38 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.MainFrameNavigated, this._onMainFrameNavigated.bind(this), this); 39 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.MainFrameNavigated, this._onMainFrameNavigated.bind(this), this);
39 this._overrideDeviceResolution = false; 40 this._overrideDeviceResolution = false;
40 this._emulateViewportEnabled = false; 41 this._emulateViewportEnabled = false;
41 this._userAgent = ""; 42 this._userAgent = "";
42 this._pageResizer = null; 43 this._pageResizer = null;
43 WebInspector.targetManager.observeTargets(this); 44 WebInspector.targetManager.observeTargets(this);
45 this._responsiveDesignAvailable = responsiveDesignAvailable;
44 } 46 }
45 47
46 WebInspector.OverridesSupport.Events = { 48 WebInspector.OverridesSupport.Events = {
47 OverridesWarningUpdated: "OverridesWarningUpdated", 49 OverridesWarningUpdated: "OverridesWarningUpdated",
48 HasActiveOverridesChanged: "HasActiveOverridesChanged", 50 HasActiveOverridesChanged: "HasActiveOverridesChanged",
49 } 51 }
50 52
51 /** 53 /**
52 * @interface 54 * @interface
53 * @extends {WebInspector.EventTarget} 55 * @extends {WebInspector.EventTarget}
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 ["Samsung Galaxy Tab 7.7, 8.9, 10.1", 394 ["Samsung Galaxy Tab 7.7, 8.9, 10.1",
393 "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", 395 "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",
394 "1280x800x1"], 396 "1280x800x1"],
395 ["Samsung Galaxy Tab", 397 ["Samsung Galaxy Tab",
396 "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", 398 "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",
397 "1024x600x1"], 399 "1024x600x1"],
398 ]; 400 ];
399 401
400 WebInspector.OverridesSupport.prototype = { 402 WebInspector.OverridesSupport.prototype = {
401 /** 403 /**
404 * @return {boolean}
405 */
406 responsiveDesignAvailable: function()
407 {
408 return this._responsiveDesignAvailable;
409 },
410
411 /**
402 * @param {?WebInspector.OverridesSupport.PageResizer} pageResizer 412 * @param {?WebInspector.OverridesSupport.PageResizer} pageResizer
403 */ 413 */
404 setPageResizer: function(pageResizer) 414 setPageResizer: function(pageResizer)
405 { 415 {
406 if (pageResizer === this._pageResizer) 416 if (pageResizer === this._pageResizer)
407 return; 417 return;
408 418
409 if (this._pageResizer) { 419 if (this._pageResizer) {
410 this._pageResizer.removeEventListener(WebInspector.OverridesSupport. PageResizer.Events.AvailableSizeChanged, this._onPageResizerAvailableSizeChanged , this); 420 this._pageResizer.removeEventListener(WebInspector.OverridesSupport. PageResizer.Events.AvailableSizeChanged, this._onPageResizerAvailableSizeChanged , this);
411 this._pageResizer.removeEventListener(WebInspector.OverridesSupport. PageResizer.Events.ResizeRequested, this._onPageResizerResizeRequested, this); 421 this._pageResizer.removeEventListener(WebInspector.OverridesSupport. PageResizer.Events.ResizeRequested, this._onPageResizerResizeRequested, this);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 if (size.height !== this.settings.deviceHeight.get()) 526 if (size.height !== this.settings.deviceHeight.get())
517 this.settings.deviceHeight.set(size.height); 527 this.settings.deviceHeight.set(size.height);
518 }, 528 },
519 529
520 _deviceMetricsChanged: function() 530 _deviceMetricsChanged: function()
521 { 531 {
522 this._showRulersChanged(); 532 this._showRulersChanged();
523 533
524 if (this._deviceMetricsChangedListenerMuted) 534 if (this._deviceMetricsChangedListenerMuted)
525 return; 535 return;
526 536 var responsiveDesignAvailableAndDisabled = this._responsiveDesignAvailab le && !WebInspector.settings.responsiveDesignMode.get();
527 var overrideDeviceResolution = this.settings.overrideDeviceResolution.ge t(); 537 var overrideDeviceResolution = this.settings.overrideDeviceResolution.ge t();
528 if (!overrideDeviceResolution && !this.settings.emulateViewport.get()) { 538 if (responsiveDesignAvailableAndDisabled || (!overrideDeviceResolution & & !this.settings.emulateViewport.get())) {
529 PageAgent.clearDeviceMetricsOverride(apiCallback.bind(this)); 539 PageAgent.clearDeviceMetricsOverride(apiCallback.bind(this));
530 if (this._pageResizer) 540 if (this._pageResizer)
531 this._pageResizer.update(0, 0, 0); 541 this._pageResizer.update(0, 0, 0);
532 this.maybeHasActiveOverridesChanged(); 542 this.maybeHasActiveOverridesChanged();
533 return; 543 return;
534 } 544 }
535 545
536 var dipWidth = overrideDeviceResolution ? this.settings.deviceWidth.get( ) : 0; 546 var dipWidth = overrideDeviceResolution ? this.settings.deviceWidth.get( ) : 0;
537 var dipHeight = overrideDeviceResolution ? this.settings.deviceHeight.ge t() : 0; 547 var dipHeight = overrideDeviceResolution ? this.settings.deviceHeight.ge t() : 0;
538 548
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 }, 929 },
920 930
921 __proto__: WebInspector.Object.prototype 931 __proto__: WebInspector.Object.prototype
922 } 932 }
923 933
924 934
925 /** 935 /**
926 * @type {!WebInspector.OverridesSupport} 936 * @type {!WebInspector.OverridesSupport}
927 */ 937 */
928 WebInspector.overridesSupport; 938 WebInspector.overridesSupport;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/overrides.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698