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

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

Issue 1771853004: [DevTools] Show viewport size on resize by default, disable in device mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (!screenHeight || screenHeight > this._preferredScaledHeight()) 423 if (!screenHeight || screenHeight > this._preferredScaledHeight())
424 screenHeight = this._preferredScaledHeight(); 424 screenHeight = this._preferredScaledHeight();
425 var mobile = this._uaSetting.get() === WebInspector.DeviceModeModel. UA.Mobile || this._uaSetting.get() === WebInspector.DeviceModeModel.UA.MobileNoT ouch; 425 var mobile = this._uaSetting.get() === WebInspector.DeviceModeModel. UA.Mobile || this._uaSetting.get() === WebInspector.DeviceModeModel.UA.MobileNoT ouch;
426 var defaultDeviceScaleFactor = mobile ? WebInspector.DeviceModeModel .defaultMobileScaleFactor : 0; 426 var defaultDeviceScaleFactor = mobile ? WebInspector.DeviceModeModel .defaultMobileScaleFactor : 0;
427 this._fitScale = this._calculateFitScale(this._widthSetting.get(), t his._heightSetting.get()); 427 this._fitScale = this._calculateFitScale(this._widthSetting.get(), t his._heightSetting.get());
428 this._appliedUserAgentType = this._uaSetting.get(); 428 this._appliedUserAgentType = this._uaSetting.get();
429 this._applyDeviceMetrics(new Size(screenWidth, screenHeight), new In sets(0, 0, 0, 0), this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile, screenHeight >= screenWidth ? "portraitPri mary" : "landscapePrimary", resetPageScaleFactor); 429 this._applyDeviceMetrics(new Size(screenWidth, screenHeight), new In sets(0, 0, 0, 0), this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile, screenHeight >= screenWidth ? "portraitPri mary" : "landscapePrimary", resetPageScaleFactor);
430 this._applyUserAgent(mobile ? WebInspector.DeviceModeModel._defaultM obileUserAgent : ""); 430 this._applyUserAgent(mobile ? WebInspector.DeviceModeModel._defaultM obileUserAgent : "");
431 this._applyTouch(this._uaSetting.get() === WebInspector.DeviceModeMo del.UA.DesktopTouch || this._uaSetting.get() === WebInspector.DeviceModeModel.UA .Mobile, this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile); 431 this._applyTouch(this._uaSetting.get() === WebInspector.DeviceModeMo del.UA.DesktopTouch || this._uaSetting.get() === WebInspector.DeviceModeModel.UA .Mobile, this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile);
432 } 432 }
433 if (this._target)
434 this._target.renderingAgent().setShowViewportSizeOnResize(this._type === WebInspector.DeviceModeModel.Type.None);
433 this._updateCallback.call(null); 435 this._updateCallback.call(null);
434 }, 436 },
435 437
436 /** 438 /**
437 * @param {number} screenWidth 439 * @param {number} screenWidth
438 * @param {number} screenHeight 440 * @param {number} screenHeight
439 * @return {number} 441 * @return {number}
440 */ 442 */
441 _calculateFitScale: function(screenWidth, screenHeight) 443 _calculateFitScale: function(screenWidth, screenHeight)
442 { 444 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 545
544 /** 546 /**
545 * @param {boolean} touchEnabled 547 * @param {boolean} touchEnabled
546 * @param {boolean} mobile 548 * @param {boolean} mobile
547 */ 549 */
548 _applyTouch: function(touchEnabled, mobile) 550 _applyTouch: function(touchEnabled, mobile)
549 { 551 {
550 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl ed, mobile); 552 WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabl ed, mobile);
551 } 553 }
552 } 554 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698