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

Side by Side Diff: Source/devtools/front_end/emulation/ResponsiveDesignView.js

Issue 1202493002: [DevTools] Refactor emulated devices modes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/emulation/EmulatedDevices.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @implements {WebInspector.OverridesSupport.PageResizer} 8 * @implements {WebInspector.OverridesSupport.PageResizer}
9 * @implements {WebInspector.TargetManager.Observer} 9 * @implements {WebInspector.TargetManager.Observer}
10 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder 10 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 }, 727 },
728 728
729 /** 729 /**
730 * @param {?WebInspector.EmulatedDevice} device 730 * @param {?WebInspector.EmulatedDevice} device
731 * @param {?WebInspector.EmulatedDevice.Mode} mode 731 * @param {?WebInspector.EmulatedDevice.Mode} mode
732 */ 732 */
733 _deviceModeSelected: function(device, mode) 733 _deviceModeSelected: function(device, mode)
734 { 734 {
735 if (device && mode) { 735 if (device && mode) {
736 var orientation = device.orientationByName(mode.orientation); 736 var orientation = device.orientationByName(mode.orientation);
737 this._deviceInsets = new Insets(mode.pageRect.left, mode.pageRect.to p, orientation.width - mode.pageRect.left - mode.pageRect.width, orientation.hei ght - mode.pageRect.top - mode.pageRect.height); 737 this._deviceInsets = mode.insets;
738 } else { 738 } else {
739 this._deviceInsets = new Insets(0, 0, 0, 0); 739 this._deviceInsets = new Insets(0, 0, 0, 0);
740 } 740 }
741 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.InsetsChanged, this._deviceInsets); 741 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.InsetsChanged, this._deviceInsets);
742 }, 742 },
743 743
744 /** 744 /**
745 * @param {!EmulationAgent.Viewport=} viewport 745 * @param {!EmulationAgent.Viewport=} viewport
746 */ 746 */
747 _viewportChanged: function(viewport) 747 _viewportChanged: function(viewport)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 WebInspector.EmulationDispatcher.prototype = { 823 WebInspector.EmulationDispatcher.prototype = {
824 /** 824 /**
825 * @override 825 * @override
826 * @param {!EmulationAgent.Viewport=} viewport 826 * @param {!EmulationAgent.Viewport=} viewport
827 */ 827 */
828 viewportChanged: function(viewport) 828 viewportChanged: function(viewport)
829 { 829 {
830 this._responsiveDesignView._viewportChanged(viewport); 830 this._responsiveDesignView._viewportChanged(viewport);
831 } 831 }
832 } 832 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/emulation/EmulatedDevices.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698