| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 * @param {string} value | 97 * @param {string} value |
| 98 * @return {boolean} | 98 * @return {boolean} |
| 99 */ | 99 */ |
| 100 WebInspector.DeviceModeModel.deviceScaleFactorValidator = function(value) | 100 WebInspector.DeviceModeModel.deviceScaleFactorValidator = function(value) |
| 101 { | 101 { |
| 102 if (!value || (/^[\d]+(\.\d+)?|\.\d+$/.test(value) && value >= 0 && value <=
10)) | 102 if (!value || (/^[\d]+(\.\d+)?|\.\d+$/.test(value) && value >= 0 && value <=
10)) |
| 103 return true; | 103 return true; |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 | 106 |
| 107 WebInspector.DeviceModeModel._defaultMobileUserAgent = "Mozilla/5.0 (Linux; Andr
oid 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.
0.2490.76 Mobile Safari/537.36"; | 107 WebInspector.DeviceModeModel._defaultMobileUserAgent = "Mozilla/5.0 (Linux; Andr
oid 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s
Mobile Safari/537.36"; |
| 108 WebInspector.DeviceModeModel._defaultMobileUserAgent = WebInspector.MultitargetN
etworkManager.patchUserAgentWithChromeVersion(WebInspector.DeviceModeModel._defa
ultMobileUserAgent); |
| 108 WebInspector.DeviceModeModel.defaultMobileScaleFactor = 2; | 109 WebInspector.DeviceModeModel.defaultMobileScaleFactor = 2; |
| 109 | 110 |
| 110 WebInspector.DeviceModeModel.prototype = { | 111 WebInspector.DeviceModeModel.prototype = { |
| 111 /** | 112 /** |
| 112 * @param {!Size} availableSize | 113 * @param {!Size} availableSize |
| 113 * @param {!Size} preferredSize | 114 * @param {!Size} preferredSize |
| 114 */ | 115 */ |
| 115 setAvailableSize: function(availableSize, preferredSize) | 116 setAvailableSize: function(availableSize, preferredSize) |
| 116 { | 117 { |
| 117 this._availableSize = availableSize; | 118 this._availableSize = availableSize; |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 630 |
| 630 /** | 631 /** |
| 631 * @param {boolean} touchEnabled | 632 * @param {boolean} touchEnabled |
| 632 * @param {boolean} mobile | 633 * @param {boolean} mobile |
| 633 */ | 634 */ |
| 634 _applyTouch: function(touchEnabled, mobile) | 635 _applyTouch: function(touchEnabled, mobile) |
| 635 { | 636 { |
| 636 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl
ed, mobile); | 637 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl
ed, mobile); |
| 637 } | 638 } |
| 638 } | 639 } |
| OLD | NEW |