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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js

Issue 2300403003: DevTools: patch browser's Chrome version into Chrome user agents for emulation (Closed)
Patch Set: renames Created 4 years, 3 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698