OLD | NEW |
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = 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); |
| 738 WebInspector.overridesSupport.settings.screenOrientationOverride.set
(mode.orientation == WebInspector.EmulatedDevice.Horizontal ? "landscapePrimary"
: "portraitPrimary"); |
738 } else { | 739 } else { |
739 this._deviceInsets = new Insets(0, 0, 0, 0); | 740 this._deviceInsets = new Insets(0, 0, 0, 0); |
| 741 WebInspector.overridesSupport.settings.screenOrientationOverride.set
(""); |
740 } | 742 } |
741 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.
Events.InsetsChanged, this._deviceInsets); | 743 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.
Events.InsetsChanged, this._deviceInsets); |
742 }, | 744 }, |
743 | 745 |
744 /** | 746 /** |
745 * @param {!EmulationAgent.Viewport=} viewport | 747 * @param {!EmulationAgent.Viewport=} viewport |
746 */ | 748 */ |
747 _viewportChanged: function(viewport) | 749 _viewportChanged: function(viewport) |
748 { | 750 { |
749 if (viewport) { | 751 if (viewport) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 WebInspector.EmulationDispatcher.prototype = { | 825 WebInspector.EmulationDispatcher.prototype = { |
824 /** | 826 /** |
825 * @override | 827 * @override |
826 * @param {!EmulationAgent.Viewport=} viewport | 828 * @param {!EmulationAgent.Viewport=} viewport |
827 */ | 829 */ |
828 viewportChanged: function(viewport) | 830 viewportChanged: function(viewport) |
829 { | 831 { |
830 this._responsiveDesignView._viewportChanged(viewport); | 832 this._responsiveDesignView._viewportChanged(viewport); |
831 } | 833 } |
832 } | 834 } |
OLD | NEW |