| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @param {function()} updateCallback | 7 * @param {function()} updateCallback |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.DeviceModeModel = function(updateCallback) | 10 WebInspector.DeviceModeModel = function(updateCallback) |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 screenImage: function() | 228 screenImage: function() |
| 229 { | 229 { |
| 230 return (this._device && this._mode) ? this._device.modeImage(this._mode)
: ""; | 230 return (this._device && this._mode) ? this._device.modeImage(this._mode)
: ""; |
| 231 }, | 231 }, |
| 232 | 232 |
| 233 /** | 233 /** |
| 234 * @return {string} | 234 * @return {string} |
| 235 */ | 235 */ |
| 236 outlineImage: function() | 236 outlineImage: function() |
| 237 { | 237 { |
| 238 return (this._device && this._mode && Runtime.experiments.isEnabled("dev
iceFrames") && this._deviceOutlineSetting.get()) ? this._device.outlineImage(thi
s._mode) : ""; | 238 return (this._device && this._mode && this._deviceOutlineSetting.get())
? this._device.outlineImage(this._mode) : ""; |
| 239 }, | 239 }, |
| 240 | 240 |
| 241 /** | 241 /** |
| 242 * @return {!WebInspector.Rect} | 242 * @return {!WebInspector.Rect} |
| 243 */ | 243 */ |
| 244 outlineRect: function() | 244 outlineRect: function() |
| 245 { | 245 { |
| 246 return this._outlineRect; | 246 return this._outlineRect; |
| 247 }, | 247 }, |
| 248 | 248 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 /** | 426 /** |
| 427 * @return {!Insets} | 427 * @return {!Insets} |
| 428 */ | 428 */ |
| 429 _currentOutline: function() | 429 _currentOutline: function() |
| 430 { | 430 { |
| 431 var outline = new Insets(0, 0, 0, 0); | 431 var outline = new Insets(0, 0, 0, 0); |
| 432 if (this._type !== WebInspector.DeviceModeModel.Type.Device) | 432 if (this._type !== WebInspector.DeviceModeModel.Type.Device) |
| 433 return outline; | 433 return outline; |
| 434 var orientation = this._device.orientationByName(this._mode.orientation)
; | 434 var orientation = this._device.orientationByName(this._mode.orientation)
; |
| 435 if (Runtime.experiments.isEnabled("deviceFrames") && this._deviceOutline
Setting.get()) | 435 if (this._deviceOutlineSetting.get()) |
| 436 outline = orientation.outlineInsets || outline; | 436 outline = orientation.outlineInsets || outline; |
| 437 return outline; | 437 return outline; |
| 438 }, | 438 }, |
| 439 | 439 |
| 440 /** | 440 /** |
| 441 * @param {boolean} resetPageScaleFactor | 441 * @param {boolean} resetPageScaleFactor |
| 442 */ | 442 */ |
| 443 _calculateAndEmulate: function(resetPageScaleFactor) | 443 _calculateAndEmulate: function(resetPageScaleFactor) |
| 444 { | 444 { |
| 445 if (!this._target) | 445 if (!this._target) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 602 |
| 603 /** | 603 /** |
| 604 * @param {boolean} touchEnabled | 604 * @param {boolean} touchEnabled |
| 605 * @param {boolean} mobile | 605 * @param {boolean} mobile |
| 606 */ | 606 */ |
| 607 _applyTouch: function(touchEnabled, mobile) | 607 _applyTouch: function(touchEnabled, mobile) |
| 608 { | 608 { |
| 609 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl
ed, mobile); | 609 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl
ed, mobile); |
| 610 } | 610 } |
| 611 } | 611 } |
| OLD | NEW |